Fixed #7839 -- Corrected admin documentation and tutorial to reflect that 'classes' should be a list and not a string. Thanks Jan Rademaker for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7983 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
dce4db49a7
commit
4729e3836e
|
@ -122,20 +122,14 @@ The ``field_options`` dictionary can have the following keys:
|
||||||
}
|
}
|
||||||
|
|
||||||
``classes``
|
``classes``
|
||||||
A string containing extra CSS classes to apply to the fieldset.
|
A list containing extra CSS classes to apply to the fieldset.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
{
|
{
|
||||||
'classes': 'wide',
|
'classes': ['wide', 'extrapretty'],
|
||||||
}
|
}
|
||||||
|
|
||||||
Apply multiple classes by separating them with spaces. Example::
|
|
||||||
|
|
||||||
{
|
|
||||||
'classes': 'wide extrapretty',
|
|
||||||
}
|
|
||||||
|
|
||||||
Two useful classes defined by the default admin-site stylesheet are
|
Two useful classes defined by the default admin-site stylesheet are
|
||||||
``collapse`` and ``wide``. Fieldsets with the ``collapse`` style will be
|
``collapse`` and ``wide``. Fieldsets with the ``collapse`` style will be
|
||||||
initially collapsed in the admin and replaced with a small "click to expand"
|
initially collapsed in the admin and replaced with a small "click to expand"
|
||||||
|
|
|
@ -192,7 +192,7 @@ aren't commonly used::
|
||||||
class PollAdmin(admin.ModelAdmin):
|
class PollAdmin(admin.ModelAdmin):
|
||||||
fieldsets = [
|
fieldsets = [
|
||||||
(None, {'fields': ['question']}),
|
(None, {'fields': ['question']}),
|
||||||
('Date information', {'fields': ['pub_date'], 'classes': 'pub_date'}),
|
('Date information', {'fields': ['pub_date'], 'classes': ['pub_date']}),
|
||||||
]
|
]
|
||||||
|
|
||||||
.. image:: http://media.djangoproject.com/img/doc/tutorial-trunk/admin09.png
|
.. image:: http://media.djangoproject.com/img/doc/tutorial-trunk/admin09.png
|
||||||
|
@ -242,7 +242,7 @@ registration code to read::
|
||||||
class PollAdmin(admin.ModelAdmin):
|
class PollAdmin(admin.ModelAdmin):
|
||||||
fieldsets = [
|
fieldsets = [
|
||||||
(None, {'fields': ['question']}),
|
(None, {'fields': ['question']}),
|
||||||
('Date information', {'fields': ['pub_date'], 'classes': 'pub_date'}),
|
('Date information', {'fields': ['pub_date'], 'classes': ['pub_date']}),
|
||||||
]
|
]
|
||||||
inlines = [ChoiceInline]
|
inlines = [ChoiceInline]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue