Ticket #7983: 7983.fields_doc.diff

File 7983.fields_doc.diff, 1.1 KB (added by Julien Phalip, 16 years ago)
  • django/django/docs/admin.txt

     
    147147    ``django.utils.html.escape()`` to escape any HTML special
    148148    characters.
    149149
     150``fields``
     151~~~~~~~~~~
     152
     153Use this option as an alternative to ``fieldsets`` if the layout does not matter and if
     154you want to only show a subset of the available fields in the form. For example, you could
     155define a simpler version of the admin form for the ``django.contrib.flatpages.FlatPage`` model
     156as follows::
     157
     158    class FlatPageAdmin(admin.ModelAdmin):
     159        fields = ('url', 'title', 'content')
     160
     161In the above example, only the fields 'url', 'title' and 'content' will be displayed, sequencially,
     162in the form.
     163
     164Remark: this ``fields`` option should not be confused with the ``fields`` dictionary key that is used
     165within the ``fieldsets`` option, as described in the previous section.
     166
    150167``filter_horizontal``
    151168~~~~~~~~~~~~~~~~~~~~~
    152169
Back to Top