Opened 8 years ago

Closed 4 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 8 years ago.
An example of nested fieldsets
nested_fieldsets.diff (9.0 KB) - added by Archatas 8 years ago.
The patch for nested fieldsets

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Archatas

Attachment: nested_fieldsets.png added

An example of nested fieldsets

Changed 8 years ago by Archatas

Attachment: nested_fieldsets.diff added

The patch for nested fieldsets

comment:1 Changed 8 years ago by Malcolm Tredinnick

milestone: 1.1 beta
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 7 years ago by Jacob

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 5 years ago by Chris Beaven

Severity: Normal
Type: New feature

comment:4 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 Changed 4 years ago by Aymeric Augustin

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