Opened 16 years ago

Closed 12 years ago

#10590 closed New feature (wontfix)

Support nested fieldsets in administration

Reported by: Archatas Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Normal Keywords: nested fieldsets
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Administration options should allow to have nested fieldsets for grouping fields in a more organized way.

For example,

# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
from halmastar.apps.sandbox.models import Contact

class ContactAdmin(admin.ModelAdmin):
    fieldsets = (
    (_("Main Info"), {'fields': ("user", "website")}),
    (_("Phones"), {'fields': (
        (_("Primary"), {'fields': (("primary_phone_country", "primary_phone_area", "primary_phone_number"),)}),
        (_("Secondary"), {'fields': (("secondary_phone_country", "secondary_phone_area", "secondary_phone_number"),)}),
        )}),
    )

admin.site.register(Contact, ContactAdmin)

The key 'fields' point to a list of field names, field-name tuples, or fieldset definitions.

Attachments (2)

nested_fieldsets.png (40.1 KB ) - added by Archatas 16 years ago.
An example of nested fieldsets
nested_fieldsets.diff (9.0 KB ) - added by Archatas 16 years ago.
The patch for nested fieldsets

Download all attachments as: .zip

Change History (8)

by Archatas, 16 years ago

Attachment: nested_fieldsets.png added

An example of nested fieldsets

by Archatas, 16 years ago

Attachment: nested_fieldsets.diff added

The patch for nested fieldsets

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: 1.1 beta

comment:2 by Jacob, 16 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by Chris Beaven, 14 years ago

Severity: Normal
Type: New feature

comment:4 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 by Aymeric Augustin, 12 years ago

Resolution: wontfix
Status: newclosed

Thanks for the proposal, but there doesn't appear to be a lot of demand for this feature, and I'm not convinced it's a win for the UX.

I suggest using custom CSS classes — the admin provides appropriate hooks to set CSS classes on fieldsets and to inject custom CSS.

Note: See TracTickets for help on using tickets.
Back to Top