summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-08-01 19:29:37 +0000
committerBrian Rosner <brosner@gmail.com>2008-08-01 19:29:37 +0000
commite7508a456ea97ec513507149280ab36cde271738 (patch)
treead5e6b62bb7c38a0c3fe8fe69f7c6c39d64c2e0e /docs
parent525e1e379af20e53819b3b34b27380eb27ca0ac8 (diff)
Fixed #7983 -- Added fields to the ModelAdmin section in the admin documentation. Thanks julien for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/admin.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/admin.txt b/docs/admin.txt
index 8c9ef71898..33e9ede4c2 100644
--- a/docs/admin.txt
+++ b/docs/admin.txt
@@ -147,6 +147,26 @@ The ``field_options`` dictionary can have the following keys:
``django.utils.html.escape()`` to escape any HTML special
characters.
+``fields``
+~~~~~~~~~~
+
+Use this option as an alternative to ``fieldsets`` if the layout does not
+matter and if you want to only show a subset of the available fields in the
+form. For example, you could define a simpler version of the admin form for
+the ``django.contrib.flatpages.FlatPage`` model as follows::
+
+ class FlatPageAdmin(admin.ModelAdmin):
+ fields = ('url', 'title', 'content')
+
+In the above example, only the fields 'url', 'title' and 'content' will be
+displayed, sequencially, in the form.
+
+.. admonition:: Note
+
+ This ``fields`` option should not be confused with the ``fields``
+ dictionary key that is within the ``fieldsets`` option, as described in
+ the previous section.
+
``filter_horizontal``
~~~~~~~~~~~~~~~~~~~~~