Opened 6 years ago

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

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by Archatas

An example of nested fieldsets

Changed 6 years ago by Archatas

The patch for nested fieldsets

comment:1 Changed 6 years ago by mtredinnick

  • milestone 1.1 beta deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 4 years ago by SmileyChris

  • Severity set to Normal
  • Type set to New feature

comment:4 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:6 Changed 2 years ago by aaugustin

  • Resolution set to wontfix
  • Status changed from new to closed

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