Re: get_FOO_basename() for FileFields

2007-02-27 Thread Ivan Sagalaev
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

Re: get_FOO_basename() for FileFields

2007-02-27 Thread herbert
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

Re: get_FOO_basename() for FileFields

2007-02-26 Thread Jacob Kaplan-Moss
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

get_FOO_basename() for FileFields

2007-02-26 Thread herbert
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