Here's the code used in the Tutorial example for collapsing in the admin
interface:
class Admin:
fields = (
(None, {'fields': ('question',)}),
('Date information', {'fields': ('pub_date',), 'classes': 'collapse'}),
)
http://www.djangoproject.com/documentation/tutorial2/
This sets up two fieldsets, 'None' (the default) and 'Date
Information'. 'Date Information' is given the class 'collapse' which
would hide the pub_date field by default unless the fieldset is expanded.
This needs to go in your model class, so you'd have something like this:
class BakedGoods(models.Model):
name = models.CharField()
ingredient = models.ForeignKey( Ingredients , blank = True , core = True )
...
class Admin:
fields = (
(None, {'fields': ('name',)}),
('Ingredients', {'fields': ('ingredient',), 'classes': 'collapse'}),
)
Jay
markguy wrote:
> As would showing me how to collapse the M2Mi
> fieldset.
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users
-~----------~----~----~----~------~----~------~--~---