Default FileField names for Django files

Posted by Adam Nelson on Stack Overflow See other posts from Stack Overflow or by Adam Nelson
Published on 2010-04-07T21:12:09Z Indexed on 2010/04/07 21:23 UTC
Read the original article Hit count: 145

Filed under:
|

I have a model:

class Example(models.Model):
    unique_hash = models.CharField(max_length=32,unique=True)
    content = models.FileField(upload_to='source',blank=True,verbose_name="HTML Content File")

I would like to be able to set the content filename to default to a callable, but I don't see any way to have the callable reference unique_hash (or vice versa). Is this possible?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-models