Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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)

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

Release History

Release History

This version
History Node

0.3.7

History Node

0.3.6

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-nested-inline-0.3.7.tar.gz (16.9 kB) Copy SHA256 Checksum SHA256 Source Feb 26, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting