Skip to main content

Recursive nesting of inline forms for Django Admin

Project description

Nested inline support for Django admin

Most of the code from this package is from [](




pip install django-nested-inline


Add nested_inline to INSTALLED_APPS

from django.db import models

class TopLevel(models.Model):

name = models.CharField(max_length=200)

class LevelOne(models.Model):

name = models.CharField(max_length=200) level = models.ForeignKey(‘TopLevel’)

class LevelTwo(models.Model):

name = models.CharField(max_length=200) level = models.ForeignKey(‘LevelOne’)

class LevelThree(models.Model):

name = models.CharField(max_length=200) level = models.ForeignKey(‘LevelTwo’)

from django.contrib import admin from nested_inline.admin import NestedStackedInline, NestedModelAdmin from example.models import *

class LevelThreeInline(NestedStackedInline):

model = LevelThree extra = 1 fk_name = ‘level’

class LevelTwoInline(NestedStackedInline):

model = LevelTwo extra = 1 fk_name = ‘level’ inlines = [LevelThreeInline]

class LevelOneInline(NestedStackedInline):

model = LevelOne extra = 1 fk_name = ‘level’ inlines = [LevelTwoInline]

class TopLevelAdmin(NestedModelAdmin):

model = TopLevel inlines = [LevelOneInline], TopLevelAdmin)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-nested-inline-springboard-0.3.8.tar.gz (16.1 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page