Thanks for the suggestion Mark.  But I dont see how overriding render
for the Select widget would help.  If I took that route, I'd be
changing the accepted meaning of that method which means I'd also have
to do it for all other Widgets, even those that I didnt know about.
Or perhaps I misunderstand you.

On 26 Jan, 20:28, Mark Jones <[email protected]> wrote:
> That almost sounds like you will have to write the renderer for that
> class.  I don't think this will be easy to do in the template, but if
> you override django.forms.widgets.Select.render. you can probably make
> it work.
>
> On Jan 26, 11:51 am, mattsouth <[email protected]> wrote:
>
> > 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