Registry / web-framework / django-nested-inline

django-nested-inline

JSON →
library0.4.6pypypiunverified

Provides recursive nesting of inline forms in Django Admin. Version 0.4.6 is the latest. Release cadence is low, with occasional updates.

pip install django-nested-inline
INSTALL
IMPORT
SIG · DJANGO-NESTED-INLI
D
django-nested-inline
web-frameworkpythonv0.4.6
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NestedModelAdmin
from nested_inline.admin import NestedModelAdmin
from nested_inline.admin import NestedModelAdmin

Define nested models with foreign keys and register admin with NestedModelAdmin to enable recursive inline editing.

# models.py from django.db import models class Parent(models.Model): name = models.CharField(max_length=100) class Child(models.Model): parent = models.ForeignKey(Parent, on_delete=models.CASCADE, related_name='children') name = models.CharField(max_length=100) class Grandchild(models.Model): child = models.ForeignKey(Child, on_delete=models.CASCADE, related_name='grandchildren') name = models.CharField(max_length=100) # admin.py from django.contrib import admin from nested_inline.admin import NestedModelAdmin, NestedTabularInline, NestedStackedInline from .models import Parent, Child, Grandchild class GrandchildInline(NestedTabularInline): model = Grandchild extra = 1 class ChildInline(NestedTabularInline): model = Child extra = 1 inlines = [GrandchildInline] class ParentAdmin(NestedModelAdmin): inlines = [ChildInline] admin.site.register(Parent, ParentAdmin)
Debug
Known issues
breakingIn v0.4.x, the import path changed from nested_inline to nested_inline.admin. Old imports will break.
fix
Change 'from nested_inline import ...' to 'from nested_inline.admin import ...'
affects: >=0.4.0
gotchaIf you don't use NestedModelAdmin but just ModelAdmin, nested inlines will not render correctly.
fix
Ensure your admin class inherits from NestedModelAdmin, not just admin.ModelAdmin.
affects: all
deprecatedThe 'inlines' attribute on inline classes (nested inlines) is experimental and may change in future versions.
fix
Keep an eye on releases for updates to nested inline declaration syntax.
affects: all
Upgrade
Version history
0.4.6latest on PyPI · released Mar 14, 2023
Audit
Dependencies
DjangorequiredCore dependency for admin and ORM
Agent activity
2 hits · last 30 days
node
2
Resources
django-nested-inline — pip install django-nested-inline · libregistry