summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-09-15 15:17:18 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-09-15 15:17:18 +0000
commit951ecbf7e6fd1abdf0857b2ab51aacf240b01fe5 (patch)
tree95c218f4ead3b3b7ca8b068e0b42860381235045 /docs
parent7c27f3e7baeb5393aeb06c476fdb52ea3a7cdc65 (diff)
Edited docs/newforms.txt changes from [6273]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/newforms.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/newforms.txt b/docs/newforms.txt
index ba0247314b..19c5fc247f 100644
--- a/docs/newforms.txt
+++ b/docs/newforms.txt
@@ -779,20 +779,20 @@ form data *and* file data::
Testing for multipart forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-If you're writing some reusable views or templates, you may not know ahead of
-time whether your form is a multipart form or not. The ``is_multipart()``
-method tells you if the form requires multipart encoding for submission::
+If you're writing reusable views or templates, you may not know ahead of time
+whether your form is a multipart form or not. The ``is_multipart()`` method
+tells you whether the form requires multipart encoding for submission::
>>> f = ContactFormWithMugshot()
>>> f.is_multipart()
True
-In a template, this sort of code could be useful::
+Here's an example of how you might use this in a template::
{% if form.is_multipart %}
- <form enctype="multipart/form-data" method="post" action="/foo/">
+ <form enctype="multipart/form-data" method="post" action="/foo/">
{% else %}
- <form method="post" action="/foo/">
+ <form method="post" action="/foo/">
{% endif %}
{% form %}
</form>