Available Inline Classes
Unfold provides four main inline classes that inherit from Django’s base inline classes:TabularInline
Display related objects in a compact table format
StackedInline
Display related objects in a detailed stacked format
GenericTabularInline
Tabular inline for generic foreign keys
GenericStackedInline
Stacked inline for generic foreign keys
Basic Usage
Import the inline classes fromunfold.admin and use them just like Django’s built-in inlines:
admin.py
Tabular Inline
TheTabularInline class displays related objects in a compact table format, ideal for models with fewer fields:
admin.py
Stacked Inline
TheStackedInline class displays each related object with all its fields stacked vertically:
admin.py
Generic Inlines
For models using Django’s contenttypes framework, use the generic inline classes:admin.py
Key Features
Unfold’s inline classes include several powerful features:Pagination
Paginate large sets of related objects
Sortable
Drag-and-drop ordering for related objects
Inline Tabs
Organize inlines into tabs
Nonrelated
Display objects without foreign key relationships
Common Configuration Options
All Unfold inline classes support these common attributes:Dictionary of field type to widget mappings. Unfold provides optimized widget overrides by default.
Dictionary of readonly field preprocessing functions.
Field name to use for drag-and-drop ordering. See Sortable Inlines.
Number of inline objects to display per page. Enables pagination when set. See Paginated Inlines.
Hide the ordering field from the inline display when using sortable inlines.
Make the inline collapsible to save space.
Next Steps
Explore the advanced inline features:Inline Tabs
Organize multiple inlines in tabs
Fieldset Tabs
Create tabs within fieldsets
Model Tabs
Configure tabs at the model level
All Unfold inline classes automatically use the
PaginationInlineFormSet or PaginationGenericInlineFormSet for enhanced pagination support.