[EMAIL PROTECTED] wrote: > Hi! > > Is there way to change "upload_to" parameter's behaviour? > I see there is hardcoded strftime replacement. > > What I want to achieve is to organise uploaded files with directories > named with uploading user's name. eg. MEDIA_ROOT/uploads/<user_id>/ >
Jay's patch is cleaner, but if you don't want to patch Django, then you can replace the upload_to attribute of the Image/FileField at runtime, with something like (I can't check the syntax right now, so this might be wrong) model._meta.get_field('my_field').upload_to = 'newpath'. Obviously, you have to do this before Django does the save itself. Damian Sinclair --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---