views:

153

answers:

1

When using Django "out-of-the-box" administration forms, the "change form" pages can be rather long for complex models (with a lot of fields).

I would like to use tabs in the "change form", so things can be more readable (group fields by tabs...)

Instead of doing it all by myself, by modifiying the 'change_form.html' admin template, I was wondering whether somebody has already done that and would like to share the code, or whether an existing Django-plugin already exist.

Thanks in advance for you answer

A: 

I'm not sure if this is easy to do out of the box, but why not put the fields in fieldsets and make these fieldsets collapsible? It's slightly less ideal possibly, but works out of the box. There's an example in the tutorial:

class PollAdmin(admin.ModelAdmin):
fieldsets = [
    (None,               {'fields': ['question']}),
    ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}),
]

In this example, the 'Date Information' fieldset can be collapsed to just the title bar.

Matt Boehm