Skip to main content

Adds useful features to inlines, such as the ability to nest them.

Project description

For now, it only adds nested inlines (see Django#9025). But I also plan to add other features I developed for my own projects.

There is no unit tests for the moment, so use at your own risks.

It would be extremely useful if someone took time to write Selenium tests.

Usage

It’s only compatible with Django 1.7.2 to 1.7.8 (I tested) and probably 1.8. Don’t even try with previous versions, django-super-inlines relies on changes that happened between 1.6 and 1.7.2.

For design reasons, you can’t nest inlines inside tabular inlines, only inside stacked inlines.

  1. pip install django-super-inlines

  2. Add 'super_inlines', to INSTALLED_APPS before 'django.contrib.admin',

  3. If you use django-grappelli, add 'super_inlines.grappelli_integration', to INSTALLED_APPS before 'grappelli', and 'super_inlines',

  4. Inherit from SuperModelAdmin instead of ModelAdmin, SuperInlineModelAdmin instead of InlineModelAdmin, and use the class attribute inlines in inlines as you do in model admins

Example usage:

from django.contrib.admin import TabularInline, StackedInline, site
from super_inlines.admin import SuperInlineModelAdmin, SuperModelAdmin

from .models import *


class RoomInlineAdmin(SuperInlineModelAdmin, TabularInline):
    model = Room


class HouseInlineAdmin(SuperInlineModelAdmin, StackedInline):
    model = House
    inlines = (RoomInlineAdmin,)


class OwnerAdmin(SuperModelAdmin):
    inlines = (HouseInlineAdmin,)


site.register(Owner, OwnerAdmin)

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

django-super-inlines-0.2.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_super_inlines-0.2.0-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file django-super-inlines-0.2.0.tar.gz.

File metadata

  • Download URL: django-super-inlines-0.2.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5

File hashes

Hashes for django-super-inlines-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ffb28b74c9ae04e638b0ed635af83265cd688fe6bf8e36f4f342007e050924ac
MD5 0a65acd50a859484b63558a0dce9e90f
BLAKE2b-256 dc0e4dcbb6341453cf4d1fcd7bb004b04ea6e5f2eaa68d4a2c0aa93baaa1a56d

See more details on using hashes here.

File details

Details for the file django_super_inlines-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: django_super_inlines-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5

File hashes

Hashes for django_super_inlines-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abfe38a5f7438294ffcbb7e7b78ed9c428760212d73228f589981a58aefb0596
MD5 4921991cfa4302f67721c73722561a96
BLAKE2b-256 a533a109d6153068ca05df3ced043596b0af1de113c991749078a6c2850fc9c0

See more details on using hashes here.

Supported by

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