Hi,
Playing on the latest SVN with newforms and FileFields, I was
wondering if there is a built-in way to retrieve the base filename of
a FileField.
Currently in my templates, {{ my_model.my_filefield }} displays the
uploaded filename appended to the value of 'upload_to', which I do not
find very attractive. Say a user uploads file 'readme.txt', I would
prefer to display 'render.txt', not 'uploaded_files/readme.txt'.
Maybe I do something wrong somewhere. Currently, I do the following
when saving the uploaded file:
my_model.save_my_filefield_file(uploaded_filename, upload_content)
All in all, I could write my own model's method get_base_filename, but
i expected Django to be nice to me and let me retrieve that base
filename for me. Thanks to let me know how I simply get the base
filename in a template...
or if there could be a need for a new method
__get_FIELD_base_filename(self, field).
Regards,
Thierry.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---