I have a Django model with a whole bunch of fields. In the Admin UI I want to group two of these fields in their own little section, but as far as I know that means I now have to specify every single model field in the fieldsets
config:
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
fieldsets = (
(
None,
{
"fields": ("field_1", "field_2", "field_3") # etc etc
}
),
(
"My special section",
{
"fields": ("field_11", "field_12")
}
)
)
It’s annoying to copy and paste so many field names, but worse: if I add a new field to the model I have to remember to add it to the fieldsets
config as well.
Is there no way to have some kind of “the rest of the fields go here” section? Or another way to only change the section of a subset of fields while leaving the rest alone?