{"id":23586,"library":"django-nested-inline","title":"django-nested-inline","description":"Provides recursive nesting of inline forms in Django Admin. Version 0.4.6 is the latest. Release cadence is low, with occasional updates.","status":"active","version":"0.4.6","language":"python","source_language":"en","source_url":"https://github.com/s-block/django-nested-inline","tags":["django","admin","nested-inline","forms"],"install":[{"cmd":"pip install django-nested-inline","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for admin and ORM","package":"Django","optional":false}],"imports":[{"note":"Old import path, renamed in 0.4.x","wrong":"from nested_inline.admin import NestedAdmin","symbol":"NestedModelAdmin","correct":"from nested_inline.admin import NestedModelAdmin"},{"note":"Common confusion, NestedStackedInline is also available but correct class is NestedTabularInline for tabular layout","wrong":"from nested_inline.admin import NestedStackedInline","symbol":"NestedTabularInline","correct":"from nested_inline.admin import NestedTabularInline"},{"symbol":"NestedStackedInline","correct":"from nested_inline.admin import NestedStackedInline"}],"quickstart":{"code":"# models.py\nfrom django.db import models\n\nclass Parent(models.Model):\n    name = models.CharField(max_length=100)\n\nclass Child(models.Model):\n    parent = models.ForeignKey(Parent, on_delete=models.CASCADE, related_name='children')\n    name = models.CharField(max_length=100)\n\nclass Grandchild(models.Model):\n    child = models.ForeignKey(Child, on_delete=models.CASCADE, related_name='grandchildren')\n    name = models.CharField(max_length=100)\n\n# admin.py\nfrom django.contrib import admin\nfrom nested_inline.admin import NestedModelAdmin, NestedTabularInline, NestedStackedInline\nfrom .models import Parent, Child, Grandchild\n\nclass GrandchildInline(NestedTabularInline):\n    model = Grandchild\n    extra = 1\n\nclass ChildInline(NestedTabularInline):\n    model = Child\n    extra = 1\n    inlines = [GrandchildInline]\n\nclass ParentAdmin(NestedModelAdmin):\n    inlines = [ChildInline]\n\nadmin.site.register(Parent, ParentAdmin)","lang":"python","description":"Define nested models with foreign keys and register admin with NestedModelAdmin to enable recursive inline editing."},"warnings":[{"fix":"Change 'from nested_inline import ...' to 'from nested_inline.admin import ...'","message":"In v0.4.x, the import path changed from nested_inline to nested_inline.admin. Old imports will break.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Ensure your admin class inherits from NestedModelAdmin, not just admin.ModelAdmin.","message":"If you don't use NestedModelAdmin but just ModelAdmin, nested inlines will not render correctly.","severity":"gotcha","affected_versions":"all"},{"fix":"Keep an eye on releases for updates to nested inline declaration syntax.","message":"The 'inlines' attribute on inline classes (nested inlines) is experimental and may change in future versions.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from nested_inline.admin import NestedModelAdmin'","cause":"Using old import path from before v0.4.0.","error":"ImportError: cannot import name 'NestedModelAdmin' from 'nested_inline'"},{"fix":"Add 'model = YourModel' to the inline class definition.","cause":"Missing 'model' attribute on the inline class.","error":"django.core.exceptions.ImproperlyConfigured: 'NestedTabularInline' does not define a 'model' attribute."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}