herbert wrote:
> as i said ... i want to use it in my templates
I may recommend to create a general-purpose template filter:
@register.filter
def basename(filename):
return os.path.basename(filename)
and then use it as:
{{ object.file|basename }}
To me it feels very Djan
as i said ... i want to use it in my templates .. where
{{ os.path.basename(object.file) }} would surely not work .. so .. the
difference is not just spelling .. it would simply not work ..
and creating a function for every FileField in every model which uses
it .. seems somehow even more odd to m
On 2/26/07, herbert <[EMAIL PROTECTED]> wrote:
> i've created a ticket (http://code.djangoproject.com/ticket/3538)
> which requests to add a function which returns the current basename of
> an uploaded file to FileFields (ie. only the bare filename, without
> any path information) .. since it was
hi,
i've created a ticket (http://code.djangoproject.com/ticket/3538)
which requests to add a function which returns the current basename of
an uploaded file to FileFields (ie. only the bare filename, without
any path information) .. since it was rejected i was asked to bring
this up here ..
my p