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

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

Built Distribution

File details

Details for the file django-nested-inline-springboard-0.3.8.tar.gz.

File metadata

  • Download URL: django-nested-inline-springboard-0.3.8.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for django-nested-inline-springboard-0.3.8.tar.gz
Algorithm Hash digest
SHA256 a7ebcbdb316fd08771b1b1c2d03e67a4d1b5e70eb41c658a762bd5e7fad5295c
MD5 0123eeb204e0c82a5ae4b4c4c5acdc0d
BLAKE2b-256 af5eb4849176dcc9261e6bf5b0682db428890572e9d9583580f68f0f7058836f

See more details on using hashes here.

File details

Details for the file django_nested_inline_springboard-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: django_nested_inline_springboard-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for django_nested_inline_springboard-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a81572026161f4b507926e9c5a8ce20c88c9e51823389cea8b0f748d5ed9b2f1
MD5 fb20e0671c6e10261c9872e0ae56aab1
BLAKE2b-256 05d60fb175a593cc0a3b3d73f468638c9c21bd90c53c07551ae7463f4aa1a6a1

See more details on using hashes here.

Supported by

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