I wish to customise a form template so that I produce forms like:

<code>
<p>my text field : </p>
<p><input type="text" ...></p>
<p>my select field : <select id=..>...</select></p>
<p>my multiline text field : </p>
<p><textarea id=...></textarea></p>
</code>

i.e. forms in a single column of paragraph tabs where usually the
field label and input field are in separate blocks, except when the
field is a select box (i.e. it's widget is a
django.forms.widgets.Select object). I'd like to iterate through the
form fields to draw the template, following <a href="http://
docs.djangoproject.com/en/dev/topics/forms/">the documentation</a>,
using something like this:

<code>
{% for field in form %}
        <p>{{ field.label_tag }} : {% if field.is_select %} {{ field }} {%
endif %}</p>
        {% if not field.is_select %}<p>{{ field }}</p>{% endif %}
{% endfor %}
</code>

but I'm having difficulty detecting the selection field.  Does anyone
have any suggestions for doing this?

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

Reply via email to