O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

23.4.2 Configuring the Add and Edit Pages

We can use the fieldsets attribute to take control of the output of the forms in both the add and edit pages of our admin, as shown in Example 23.24.

Example 23.24: Project Code

user/admin.py in 3dc9075fbf

 7   class UserAdmin(admin.ModelAdmin):  .       ... 22       # form view 23       fieldsets = ( 24            (None, {'fields': ('email', 'password')}), 25            ('Permissions', { 26                'fields': ( 27                     'is_active', 28                     'is_staff', 29                     'is_superuser', 30                     'groups', 31                     'user_permissions')}), 32            ('Important dates', { 33                'fields' : (

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required