#14077: Need an easy way to display model instance field names and values in
templates
---------------------+------------------------------------------------------
 Reporter:  haroldb  |       Owner:  nobody    
   Status:  new      |   Milestone:            
Component:  Forms    |     Version:  1.2       
 Keywords:           |       Stage:  Unreviewed
Has_patch:  0        |  
---------------------+------------------------------------------------------
 Is it possible to write a helper that would take a bound ModelForm, and
 allow it to be displayed in a template something like:


 {{{
 <table>
     {% for field in fields %}
         <tr>
             <td>{{ field.name }}</td>
             <td>{{ field.value }}</td>
         </tr>
     {% endfor %}
 </table>
 }}}

 It would only display those fields that should be displayed to users (e.g.
 ignore 'editable=False', etc).

 This would make displaying models to users much simpler, since if the
 definition of the model changed, it wouldn't be necessary to update the
 template. It'd be great if this was a standard helper.

 Thanks

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14077>
Django <http://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