From 1809f6e256622d9813d8af9a338d9ba10d8cf531 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 28 Apr 2006 23:13:29 +0000 Subject: [PATCH] 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 --- docs/model-api.txt | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/docs/model-api.txt b/docs/model-api.txt index 4a0668a816..ed1794f816 100644 --- a/docs/model-api.txt +++ b/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: