django-constance icon indicating copy to clipboard operation
django-constance copied to clipboard

Collapse fieldsets when I am using Ordered dict

Open ghost opened this issue 5 years ago • 2 comments

Describe the problem

I want to "collapse" my fieldsets in the same with OrderedDict. How can I do it?

System configuration

  • Django version: 2.2
  • Python version: 3.6

ghost avatar May 26 '20 06:05 ghost

I'm also wondering this

truthdoug avatar Mar 03 '23 15:03 truthdoug

Using the General Options example from the docs: https://django-constance.readthedocs.io/en/latest/#ordered-fields-in-django-admin

Think of the OrderedDict() as a collection of tuples where the first element will be the fieldset name, and the second element will be a dict that can contain the "fields" key and the "collapse" key.

CONSTANCE_CONFIG_FIELDSETS = OrderedDict(
    [
        (
            "General Options",
            (
                {
                    "fields": ("SITE_NAME", "SITE_DESCRIPTION"),
                    "collapse": True,
                }
            ),
        ),
        ("Theme Options", ("THEME",)),
    ]
)

arkmalcom avatar Apr 06 '23 18:04 arkmalcom