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>/
Regards,
ciukes.
Jay P.
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