Django

Code

Changeset 6288

Show
Ignore:
Timestamp:
09/15/07 10:17:18 (1 year ago)
Author:
adrian
Message:

Edited docs/newforms.txt changes from [6273]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/newforms.txt

    r6273 r6288  
    780780~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    781781 
    782 If you're writing some reusable views or templates, you may not know ahead of 
    783 time whether your form is a multipart form or not. The ``is_multipart()`` 
    784 method tells you if the form requires multipart encoding for submission:: 
     782If you're writing reusable views or templates, you may not know ahead of time 
     783whether your form is a multipart form or not. The ``is_multipart()`` method 
     784tells you whether the form requires multipart encoding for submission:: 
    785785 
    786786    >>> f = ContactFormWithMugshot() 
     
    788788    True 
    789789 
    790 In a template, this sort of code could be useful:: 
     790Here's an example of how you might use this in a template:: 
    791791 
    792792    {% if form.is_multipart %} 
    793       <form enctype="multipart/form-data" method="post" action="/foo/"> 
     793        <form enctype="multipart/form-data" method="post" action="/foo/"> 
    794794    {% else %} 
    795       <form method="post" action="/foo/"> 
     795        <form method="post" action="/foo/"> 
    796796    {% endif %} 
    797797    {% form %}