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.
pip install django-super-inlines
Add 'super_inlines', to INSTALLED_APPS before 'django.contrib.admin',
If you use django-grappelli, add 'super_inlines.grappelli_integration', to INSTALLED_APPS before 'grappelli', and 'super_inlines',
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
Built Distribution
Hashes for django-super-inlines-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffb28b74c9ae04e638b0ed635af83265cd688fe6bf8e36f4f342007e050924ac |
|
MD5 | 0a65acd50a859484b63558a0dce9e90f |
|
BLAKE2b-256 | dc0e4dcbb6341453cf4d1fcd7bb004b04ea6e5f2eaa68d4a2c0aa93baaa1a56d |
Hashes for django_super_inlines-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abfe38a5f7438294ffcbb7e7b78ed9c428760212d73228f589981a58aefb0596 |
|
MD5 | 4921991cfa4302f67721c73722561a96 |
|
BLAKE2b-256 | a533a109d6153068ca05df3ced043596b0af1de113c991749078a6c2850fc9c0 |