diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-05-08 07:32:31 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-05-08 07:32:31 +0000 |
| commit | e34ca2b1e214799b2b474dcc2a5f20e80a987d8d (patch) | |
| tree | 53a5e8c8d2317d5b26ec6b7d7078714d8f1916e7 /docs/topics/forms/modelforms.txt | |
| parent | 0cb2ae9123940611599566add12d438029a863f1 (diff) | |
Fixed #13269 -- Added clarifying import statement to widget override docs. Thanks to mattrowbum for the report, and Gabriel Hurley for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/forms/modelforms.txt')
| -rw-r--r-- | docs/topics/forms/modelforms.txt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index 00ef5b4cb5..066545756f 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -379,9 +379,12 @@ To specify a custom widget for a field, use the ``widgets`` attribute of the inner ``Meta`` class. This should be a dictionary mapping field names to widget classes or instances. -For example, if you want the a ``CharField`` to be represented by a -``<textarea>`` instead of its default ``<input type="text">``, you can override -the field's widget:: +For example, if you want the a ``CharField`` for the ``name`` +attribute of ``Author`` to be represented by a ``<textarea>`` instead +of its default ``<input type="text">``, you can override the field's +widget:: + + from django.forms import ModelForm, TextArea class AuthorForm(ModelForm): class Meta: |
