#7838: Type inconsistency in part 2 of the tutorial
--------------------------------------------------+-------------------------
Reporter: kratorius | Owner: nobody
Status: new | Milestone:
Component: Documentation | Version: SVN
Keywords: doc documentation newforms-admin nfa | Stage: Unreviewed
Has_patch: 0 |
--------------------------------------------------+-------------------------
In the "''Customize the admin form''" section, we have the following code
snippet:
{{{
#!python
class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes':
'pub_date'}),
]
}}}
But that should be:
{{{
#!python
class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes':
['collapse']}),
]
}}}
There are two issues here with the {{{classes}}} attribute:
* the argument should be {{{collapse}}}, not {{{pub_date}}}
* and should be an iterable sequence, not a string as in the admin is
then rendered as "{{{c o l l a p s e}}}" (iterating over the chars)
Now it's not clear what should be the right behaviour: accept both
iterable sequences and strings (by "special casing" them, a {{{if
type(sequence) == str: sequence = [sequence]}}} should do the work), or
raising some error if the wrong type is passed.
The same error is in the second example of the "''Adding related
objects''" section.
--
Ticket URL: <http://code.djangoproject.com/ticket/7838>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---