Currently, Django won't overwrite uploaded files, it'll append a "_" to the filename until it's unique. Django does let you organise files by strftime formatting - http://www.djangoproject.com/documentation/model-api/#filefield - it might be worth checking djangosnippets.org or searching in the bug tracker to see if someone's already proposed a solution to organising uploads by things other than date/time.
On Mar 9, 9:51 pm, Nick Day <[EMAIL PROTECTED]> wrote: > Hi, > > I'm quite new to Django so apologies if this is a really easy > question! > > I have a model with several fields, some of which are ImageFields. To > help prevent files overwriting others (if they are uploaded with the > same name), and for organisational reasons, I would like to upload the > images to a folder using the ID of the record. For example - I'm > adding a record with an autogenerated primary key ID of "12" - so I > would like my photos to be uploaded to "/media/12/" when I click the > Save button for that record. > > Hope somebody here can suggest a solution! > > Cheers, > Nick --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---