November 2015
Beginner to intermediate
840 pages
26h 30m
English
Even though the add and edit pages are different, many of the admin’s options configure both pages. The fieldsets option, for instance, allows us to define which fields are available on the forms in each page and further allow us to organize the fields, as shown in Example 23.10.
Example 23.10: Project Code
7 class PostAdmin(admin.ModelAdmin): . ... 13 # form view 14 fieldsets = ( 15 (None, { 16 'fields': ( 17 'title', 'slug', 'author', 'text', 18 )}), 19 ('Related', { 20 'fields': ( 21 'tags', 'startups')}), 22 ) ...
Read now
Unlock full access