Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

magic-removal: Fixed #1712 -- Removed typo and clarified use of admin…

… options in model-api docs

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2772 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1809f6e256622d9813d8af9a338d9ba10d8cf531 1 parent 6ec3a4d
@freakboy3742 freakboy3742 authored
Showing with 15 additions and 11 deletions.
  1. +15 −11 docs/model-api.txt
View
26 docs/model-api.txt
@@ -921,15 +921,17 @@ Here's a list of all possible ``Admin`` options. No options are required. Adding
For example (taken from the ``django.contrib.flatpages`` model)::
- fields = (
- (None, {
- 'fields': ('url', 'title', 'content', 'sites')
- }),
- ('Advanced options', {
- 'classes': 'collapse',
- 'fields' : ('enable_comments', 'registration_required', 'template_name')
- }),
- ),
+ class Admin:
+ ...
+ fields = (
+ (None, {
+ 'fields': ('url', 'title', 'content', 'sites')
+ }),
+ ('Advanced options', {
+ 'classes': 'collapse',
+ 'fields' : ('enable_comments', 'registration_required', 'template_name')
+ }),
+ )
results in an admin that looks like:
@@ -978,8 +980,10 @@ Here's a list of all possible ``Admin`` options. No options are required. Adding
Here's an example of how ``list_display`` and ``list_filter`` work (taken
from the ``auth.user`` model)::
- list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff'),
- list_filter = ('is_staff', 'is_superuser'),
+ class Admin:
+ #...
+ list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff')
+ list_filter = ('is_staff', 'is_superuser')
The above code results in an admin that looks like this:
Please sign in to comment.
Something went wrong with that request. Please try again.