Skip to content

Commit

Permalink
Edited some recent docs changes
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9042 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Sep 16, 2008
1 parent 3b0bf98 commit 772639c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/ref/forms/api.txt
Expand Up @@ -96,7 +96,7 @@ e-mail address::
>>> f = ContactForm(data) >>> f = ContactForm(data)
>>> f.is_valid() >>> f.is_valid()
False False

.. attribute:: Form.errors .. attribute:: Form.errors


Access the :attr:`~Form.errors` attribute to get a dictionary of error Access the :attr:`~Form.errors` attribute to get a dictionary of error
Expand Down Expand Up @@ -530,7 +530,7 @@ string or Unicode object, respectively::
>>> unicode(f['subject']) >>> unicode(f['subject'])
u'<input id="id_subject" type="text" name="subject" maxlength="100" />' u'<input id="id_subject" type="text" name="subject" maxlength="100" />'


Form objects define a custom ``__iter__`` method which allows you to loop Form objects define a custom ``__iter__()`` method, which allows you to loop
through their fields:: through their fields::


>>> f = ContactForm() >>> f = ContactForm()
Expand Down
12 changes: 6 additions & 6 deletions docs/topics/forms/index.txt
Expand Up @@ -295,9 +295,9 @@ templates:
Reusable form templates Reusable form templates
----------------------- -----------------------


If your site uses the same rendering logic for forms in multiple places you If your site uses the same rendering logic for forms in multiple places, you
can create a template that contains just the form loop and use the can reduce duplication by saving the form's loop in a standalone template and
:ttag:`include` tag to reuse it in your other templates:: using the :ttag:`include` tag to reuse it in other templates::


<form action="/contact/" method="POST"> <form action="/contact/" method="POST">
{% include "form_snippet.html" %} {% include "form_snippet.html" %}
Expand All @@ -314,7 +314,7 @@ can create a template that contains just the form loop and use the
{% endfor %} {% endfor %}


If the form object passed to a template has a different name within the If the form object passed to a template has a different name within the
context you can alias it using the :ttag:`with` tag:: context, you can alias it using the :ttag:`with` tag::


<form action="/comments/add/" method="POST"> <form action="/comments/add/" method="POST">
{% with comment_form as form %} {% with comment_form as form %}
Expand All @@ -323,8 +323,8 @@ context you can alias it using the :ttag:`with` tag::
<p><input type="submit" value="Submit comment" /></p> <p><input type="submit" value="Submit comment" /></p>
</form> </form>


You can also create a custom :ref:`inclusion If you find yourself doing this often, you might consider creating a custom
tag<howto-custom-template-tags-inclusion-tags>`. :ref:`inclusion tag<howto-custom-template-tags-inclusion-tags>`.


Further topics Further topics
============== ==============
Expand Down

0 comments on commit 772639c

Please sign in to comment.