Skip to main content

Inlines

SmartBase Admin supports inlines in a powerful and flexible way using a set of custom classes extending Django’s built-in inline functionality.

Inlines allow related objects to be edited on the same page as the parent object. django-smartbase-admin enhances this with a polished UI, sortable support and tabular/stacked rendering options out of the box.

Available Inline Classes

The following inline classes are available and can be used depending on your needs:

SBAdminTableInline

catalog/sb_admin.py
class ProductImageInline(SBAdminTableInline):
model = ProductImage
fields = ("image", "alt_text")
extra = 1

SBAdminStackedInline

catalog/sb_admin.py
class ProductImageInline(SBAdminStackedInline):
model = ProductImage
fields = ("image", "alt_text")
extra = 1

SBAdminGenericTableInline and SBAdminGenericStackedInline are same as SBAdminTableInline and SBAdminStackedInline, but Generic inlines allow you to manage related objects that use GenericForeignKey.