django-nested-admin shows the example code which has 3 levels "TableOfContentsAdmin", "TocSectionInline" and "TocArticleInline" as shown below:
# An example admin.py for a Table of Contents app
from django.contrib import admin
import nested_admin
from .models import TableOfContents, TocArticle, TocSection
class TocArticleInline(nested_admin.NestedStackedInline): # 3rd Level
model = TocArticle
sortable_field_name = "position"
class TocSectionInline(nested_admin.NestedStackedInline): # 2nd Level
model = TocSection
sortable_field_name = "position"
inlines = [TocArticleInline]
class TableOfContentsAdmin(nested_admin.NestedModelAdmin): # 1st Level
inlines = [TocSectionInline]
admin.site.register(TableOfContents, TableOfContentsAdmin)
Now, how deep can django-nested-admin have nested inlines? Only 3 levels?
6 levels for me. But, the deeper levels are created, the slower the page is displayed.
First, I created 10 models as shown below:
Then, created 10 levels as shown below:
But, when clicking on "ADD FIRST" button, I got errors. In addition, I tried 9, 8 and 7 levels but, I got errors as well:
Finally, I tried 6 levels as shown below:
Then, I could display 6 levels as shown below but it's very slow to be displayed: