Overview
This guide walks you through creating a complete tabbed admin interface for a polling application. You’ll learn how to useAdminTab, AdminChangeListTab, and TabbedModelAdmin to organize your admin interface.
Example Application
We’ll build an admin interface for a simple polling app with three models:- Poll: Contains a question
- Choice: Multiple choice options for each poll
- Answer: User responses to poll choices
Step-by-Step Guide
Create an inline for related objects
Define a standard Django inline for the Choice model:This inline will be displayed within the Poll tab.
admin.py
Create an AdminTab for the main form
Create an
AdminTab class to display the poll form:admin.py
AdminTab inherits from admin.ModelAdmin, so you can use all standard Django admin options like fields, fieldsets, inlines, readonly_fields, etc.Create an AdminChangeListTab for nested objects
Create an Key attributes explained:
AdminChangeListTab to display answers related to the poll:admin.py
admin_tab_name: The display name for the tabmodel: The model this changelist displaysfk_field: The relationship path to filter objects by the parentparent_model: The model of the parent object (Poll)parent_object: Available at runtime to access the current parent instance
Create the TabbedModelAdmin
Finally, create the main admin class that ties everything together:The
admin.py
admin_tabs list defines which tabs appear and in what order.Complete Example
Here’s the completeadmin.py file:
admin.py
Visual Result
When you edit a Poll in the admin, you’ll see a tabbed interface:AdminTab Example

AdminChangeListTab Example

Key Concepts
Independent Loading
Each tab loads and saves independently at its own URL. Changes in one tab don’t affect others until saved.
Filtered Changelists
AdminChangeListTab automatically filters the queryset to show only objects related to the parent instance.Standard Admin Features
Use all Django admin features:
fieldsets, inlines, list_display, list_filter, search_fields, and more.Access Parent Object
Within
AdminChangeListTab, use self.parent_object to access the parent instance in methods like get_form() or get_queryset().Known Limitations
Next Steps
AdminTab Concepts
Learn more about AdminTab and how to customize tabs
AdminChangeListTab Concepts
Dive deeper into nested changelists and filtering
API Reference
Explore the complete API reference for all classes
Examples
See more real-world examples and use cases