[Django]-Group fields in Django's admin forms

38👍

You can do this with fieldsets.

For example:

class MyModelAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {
           'fields': ('field1', 'field2', 'field3')
        }),
        ('Advanced options', {
            'fields': ('field4', 'field5'),
        }),
    )

See the docs for more information.

Leave a comment