Skip to content

Override multiple fieldsets of base_fieldsets #472

@Lorac

Description

@Lorac

I have a model with extra fields but I would like to show these extra fields inside already existing fieldsets from the form base class.

I was able to do it with something like

def merge_by_key(ts):

    dic = {}
    for i, j in ts:
        dic.setdefault(i,{}).setdefault('fields', ())
        dic[i]['fields'] += tuple(j['fields'])

    return tuple((k, v) for k, v in dic.items())

I can only override one section here because it's based on the extra_fieldset_title

This doesn't control where the fields end up in the fieldsets.

If I use extra_fieldset_title with the same name, well I just get 2 fieldsets with the same names.

For a case like this, should I just fully override base_fieldsets for each subclasses? Which is kind of annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions