On Mar 12, 12:53 pm, NoviceSortOf <dljonsson2...@gmail.com> wrote:
> In my html template i have something like
>
> {% for field in form %}
>     {{ field.label_tag }}
>     {{ field }}
> {% endfor %}
> ....
> Which loops and displays the field name and field value in the form.
>
> On smaller forms, I would prefer to do this manually
>  w/o the loop by saying something like.
> ...
> {{ form.id_first_name.label_tag }} {{ field }}
> {{ form.id_last_name.label_tag }}  {{ field }}

{{ form.first_name.label_tag }} {{ form.first_name }}
{{ form.last_name.label_tag }} {{ form.last_name }}

See: 
http://docs.djangoproject.com/en/dev//topics/forms/#customizing-the-form-template

-RD

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

Reply via email to