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 rejected i was asked to bring
> this up here ..
>
> my point is, that the only useful information a user would like to see
> (and i have to put into a template) could be the bare filename (beside
> the download url of course), noone cares about where it is stored on
> the server.. it would make it by far easier to just have an additional
> method than using template tags or custom methods for each model which
> uses FileFields to filter out the filename ..

I rejected this function because it's a creeping feature.  There's no
real difference between (using a file field called "file")::

    object.get_file_basename()

and::

    os.path.basename(object.file)

except spelling (and three measly characters).  If you really want
this to be a function on your model, just define a custom method.

In general, the principle is this: the more little bits you add on any
projec, the more complex all the various code interactions become, and
the more possibility for breakage there is.  This means that features
should only be added to core if they provide functionality that can't
really be reproduced elsewhere.

Jacob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to