Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #7983 -- Added fields to the ModelAdmin section in the admin do…

…cumentation. Thanks julien for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e7508a456ea97ec513507149280ab36cde271738 1 parent 525e1e3
Brian Rosner authored

Showing 1 changed file with 20 additions and 0 deletions. Show diff stats Hide diff stats

  1. 20  docs/admin.txt
20  docs/admin.txt
@@ -147,6 +147,26 @@ The ``field_options`` dictionary can have the following keys:
147 147
     ``django.utils.html.escape()`` to escape any HTML special
148 148
     characters.
149 149
 
  150
+``fields``
  151
+~~~~~~~~~~
  152
+
  153
+Use this option as an alternative to ``fieldsets`` if the layout does not
  154
+matter and if you want to only show a subset of the available fields in the
  155
+form. For example, you could define a simpler version of the admin form for
  156
+the ``django.contrib.flatpages.FlatPage`` model as follows::
  157
+
  158
+    class FlatPageAdmin(admin.ModelAdmin):
  159
+        fields = ('url', 'title', 'content')
  160
+
  161
+In the above example, only the fields 'url', 'title' and 'content' will be
  162
+displayed, sequencially, in the form.
  163
+
  164
+.. admonition:: Note
  165
+
  166
+    This ``fields`` option should not be confused with the ``fields``
  167
+    dictionary key that is within the ``fieldsets`` option, as described in
  168
+    the previous section.
  169
+
150 170
 ``filter_horizontal``
151 171
 ~~~~~~~~~~~~~~~~~~~~~
152 172
 

0 notes on commit e7508a4

Please sign in to comment.
Something went wrong with that request. Please try again.