Skip to content

Commit

Permalink
Merge pull request django#359 from nmartini/ticket_18832
Browse files Browse the repository at this point in the history
Fixed #18832 - Updated ModelForm example fields to match note below
  • Loading branch information
timgraham committed Sep 8, 2012
2 parents b139cfc + 5716989 commit 76bd335
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/topics/forms/modelforms.txt
Expand Up @@ -311,18 +311,18 @@ model fields:
to exclude from the form.

For example, if you want a form for the ``Author`` model (defined
above) that includes only the ``name`` and ``title`` fields, you would
above) that includes only the ``name`` and ``birth_date`` fields, you would
specify ``fields`` or ``exclude`` like this::

class PartialAuthorForm(ModelForm):
class Meta:
model = Author
fields = ('name', 'title')
fields = ('name', 'birth_date')

class PartialAuthorForm(ModelForm):
class Meta:
model = Author
exclude = ('birth_date',)
exclude = ('title',)

Since the Author model has only 3 fields, 'name', 'title', and
'birth_date', the forms above will contain exactly the same fields.
Expand Down

0 comments on commit 76bd335

Please sign in to comment.