Patches have been submitted, and repositories forked, but no one likes to use either one. Now, nested inlines are available in an easy-to-install package.
The Javascript portion of this app is currently buggy. The Python portion should be solid. Please test and file issues and pull requests to improve it!
pip install -e git+git://github.com/Soaa-/django-nested-inlines.git#egg=django-nested-inlines
nested_inlines.admin
contains three ModelAdmin
subclasses to enable
nested inline support: NestedModelAdmin
, NestedStackedInline
, and
NestedTabularInline
. To use them:
nested_inlines
to your INSTALLED_APPS
before
django.contrib.admin
. This is because this app overrides certain admin
templates and media.NestedModelAdmin
, NestedStackedInline
, and NestedTabularInline
wherever you want to use nested inlines.NestedModelAdmin
rather than the standard ModelAdmin
.Nested
versions instead of the standard ones.inlines = [MyInline,]
attribute to your inlines and watch the
magic happen.from django.contrib import admin
from nested_inlines.admin import NestedModelAdmin, NestedStackedInline, NestedTabularInline
from models import A, B, C
class MyNestedInline(NestedTabularInline):
model = C
class MyInline(NestedStackedInline):
model = B
inlines = [MyNestedInline,]
class MyAdmin(NestedModelAdmin):
pass
admin.site.register(A, MyAdmin)
This package is mainly the work of other developers. I've only taken their patches and packaged them nicely for ease of use. Credit goes to: