class Project(models.Model):
slug = models.SlugField(max_length=100)
main_file = models.FilePathField(path="/home/mn/myfiles/%s" % slug)
This code doesn't work, just illustrating what I'd like to do.
I want to fill in FilePathField
when object is accessed (ie. when it is updated in django admin, not when it's created).
Is there a hook where you can set fields just before they are filled? Something like object.on_get(instance):
... perhaps?