Django Suit provides handy shortcut to include templates into forms for several positions (top, middle and bottom).
Under the hood: Suit includes are nothing but a shortcut. The same can be achieved by extending
change_form.html and hooking into particular blocks. Suit includes can be used in combination with or without Form tabs.
suit_form_includes item can contain 3 parameters:
- Path to template (Required)
- Position: (Optional)
top- above fieldsets:
middle- between fieldsets and inlines
bottom- after inlines (Default)
TAB_NAMEif using in combination with Form tabs (Optional)
from django.contrib import admin from .models import Country class CountryAdmin(admin.ModelAdmin): ... suit_form_includes = ( ('admin/examples/country/custom_include.html', 'middle', 'cities'), ('admin/examples/country/tab_info.html', '', 'info'), ('admin/examples/country/disclaimer.html'), )