#16033: get_field_display: Django needs a filter to allow get_field_display for 
a
dynamic field
-------------------------+---------------------------------
 Reporter:  thepapermen  |          Owner:  nobody
     Type:  New feature  |         Status:  new
Milestone:               |      Component:  Template system
  Version:  1.3          |       Severity:  Normal
 Keywords:               |   Triage Stage:  Unreviewed
Has patch:  0            |  Easy pickings:  0
-------------------------+---------------------------------
 {{ SomeModel.get_field_display }} is nice, but it is handy only for a
 specified field.

 If One wants to write a more universal template which should work with any
 set of fields, this won't work.

 What I propose is a universal filter which should provide human-readable
 name for a field of any type.

 For example, like this:

 <table>
     {% for item in query %}
         <tr>
             {% for field in fields %}
                 <td>{{item|human_readable:field}}</td>
             {% endfor %}
         </tr>
     {% endfor %}
 <table>

 This will be a simple yet powerful way to create nice human-readable
 tables from Django models and forms.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/16033>
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to