def get_file_path(instance, filename):
ext = filename.split('.')[-1]
filename = "%s.%s" % (str(instance.uuid), ext)
return os.path.join('uploads','data', filename)
class Image(models.Model):
name = models.CharField(blank=True, max_length=250)
image = models.FileField(upload_to=get_file_path)
uuid = UUIDField(auto=True)