Wednesday, May 19, 2010

Extremely simple question that I can't get a simple answer for in Docs

Frustratingly enough, docs.djangoproject.com tells you how to print
out the HMTL for a single field in your form, but it uses a shell to
demonstrate it:

f = ContactForm()
>>> print f['subject']
<input id="id_subject" type="text" name="subject" maxlength="100" /
>
>>> print f['message']


However, I need to know how to do this in a template

I tried placing my form in the template like {{ f['subject'] }} and I
get TemplateSyntaxError. Of course using my own form and existing
fields


What is the syntax for this.

I tried all types of search terms to hopefully catch a thread with
someone doing this, but ended up at zero.

Thanks

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate