On 11/6/07, Frank 7200 <[EMAIL PROTECTED]> wrote: > I have a Field class for attachments and I would like to rename the > attachment after upload. This class inherits from models.ImageField. > > The problem is that in field method save_file() and _save() all values > pointing to ID are None. > new_object['id'] is None and instance._get_pk_val() is None > > In which method is the ID available?
There's no "official" way to do this yet, but I just published an article[1] which tries to answer a number of questions regarding FileField and filenames. Hopefully this helps with your question as well. -Gul [1] http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---