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.2.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

django_super_inlines-0.2.2-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-super-inlines-0.2.2.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for django-super-inlines-0.2.2.tar.gz
Algorithm Hash digest
SHA256 cc2ee07efd28776d1295b3884f3c79e2efe8288115afc3e9dfae3c8de87378a6
MD5 ee242011e0657be6e6633cdd85fea837
BLAKE2b-256 a9a6ddfe943dea98eaab2dbb21060b231a7ba75139e7471da639f8755e6c9889

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_super_inlines-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 587a9391840cac346e6903b66d3a9fc7222cb5e22190ff2522cc7981a4a17adc
MD5 5dd1c693156b3a714d79f35fc57bb4ad
BLAKE2b-256 9186da6281c93bf91639e882d52a5bd32714d8ff63448c6485a2dfe156cc85b7

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