#14497: ModelAdmin.readonly_fields isn't graceful with filefields.
-------------------------------------+-------------------------------------
     Reporter:  Keryn Knight         |                    Owner:
  <keryn@…>                          |  adamjforster
         Type:  New feature          |                   Status:  assigned
    Component:  contrib.admin        |                  Version:  1.2
     Severity:  Normal               |               Resolution:
     Keywords:  feature admin        |             Triage Stage:  Accepted
  readonly filefield                 |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  1                    |                    UI/UX:  1
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by javiersanchez@…):

 Let me suggest a small adding. Usually is not necessary to show the
 complete path, but just the file name. This is trivial by "import os.path"
 and applying "os.path.basename" as below:

             return mark_safe(u'<a href="%s">%s</a>'
                 % (escape(value.url),
                     os.path.basename(force_unicode(value))))

-- 
Ticket URL: <https://code.djangoproject.com/ticket/14497#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en.

Reply via email to