Skip to main content

Nested inline support for Django admin

Most of the code from this package is from [https://code.djangoproject.com/ticket/9025](https://code.djangoproject.com/ticket/9025)

Github

[https://github.com/s-block/django-nested-inline](https://github.com/s-block/django-nested-inline)

Installation

pip install django-nested-inline

Usage

Add nested_inline to INSTALLED_APPS

models.py

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’)

admin.py

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]

admin.site.register(TopLevel, TopLevelAdmin)

Changelist

0.3.7 - added support for django 1.10, fix unique fieldset id

0.3.6 - added support for django 1.9

0.3.5 - Removed deprecated methods and updated for Django 1.8/1.9

0.3.4 - added licence and updated for python 3

0.3.3 - fixed bug where inlines without inlines would cause an error

Metadata

Release files for django-nested-inline-py3 0.3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-nested-inline-py3 0.3.8
File Size Uploaded
django-nested-inline-py3-0.3.8.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-nested-inline-py3 0.3.8
File Interpreter ABI Platform
django_nested_inline_py3-0.3.8-py3-none-any.whl Python 3 none any Details

Total release size: 36.9 kB

Release files / django-nested-inline-py3-0.3.8.tar.gz

Download URL django-nested-inline-py3-0.3.8.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
565a677694bfdfe2f6d312cea8d007e3e38fda296f4946d5abd00a06768d47fa
BLAKE2b-256 checksum
How to use checksums
5319cbdfc0a2abff5e4ca98774a1c252db4c8488e66bac14a772fbcdbde9b255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / django_nested_inline_py3-0.3.8-py3-none-any.whl

Download URL django_nested_inline_py3-0.3.8-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce183eb991508be2250b0ec4c2efc2b2b40513735595df2bf0f8bc578fb93c84
BLAKE2b-256 checksum
How to use checksums
b143cb046d98570dd69aece84ed31c6e2d583584e6790cf478e852e95ddea8b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3.8 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page