I have a field in my model of type FileField . This gives me an object of type File , which has the following method:
File.name : file name, including the relative path from MEDIA_ROOT .
I want something like " .filename " that will give me only the file name, not the path, something like:
{% for download in downloads %} <div class="download"> <div class="title">{{download.file.filename}}</div> </div> {% endfor %}
To give something like myfile.jpg
django django-templates django-file-upload
John Apr 21 '10 at 2:09 p.m. 2010-04-21 14:09
source share