I'm trying to pass a custom upload_to function to my models imageField but I'd like to define the function as a model function....is that possible?
class MyModel(models.Model):
...
image = models.ImageField(upload_to=self.get_image_path)
...
def get_image_path(self, filename):
...
return image_path
Now i know i can't reference it by 'self' since self doesn't exist at that point...is there a way to do this? If not - where is the best place to define that function?