Updated example to demonstrate SortableStackedInline

master
Brandon Taylor 2011-09-03 22:10:27 -05:00
parent 5d10de5ed4
commit 7ad1925ec1
1 changed files with 19 additions and 3 deletions

22
README
View File

@ -94,6 +94,22 @@ SortableTabularInline:
"""Your inline options go here""" """Your inline options go here"""
To enable sorting on StackedInline models, you need to inherit from
SortableStackedInline:
from adminsortable.admin import SortableStackedInline
class MySortableStackedInline(SortableStackedInline):
"""Your inline options go here"""
!!! *IMPORTANT* !!!
With stacked inline models, their height can dynamically increase,
which can cause sortable stacked inlines to not behave as expected.
If the height of the stacked inline is going to be very tall, I would
suggest NOT using SortableStackedInline. I'm currently working on
a way to make this more usable.
Rationale Rationale
============= =============
Other projects have added drag-and-drop ordering to the ChangeList Other projects have added drag-and-drop ordering to the ChangeList
@ -119,16 +135,16 @@ Current
- Supports Django 1.3+ - Supports Django 1.3+
- Adds an admin view to any model that inherits from Sortable and SortableAdmin - Adds an admin view to any model that inherits from Sortable and SortableAdmin
that allows you to drag and drop objects into any order via jQueryUI. that allows you to drag and drop objects into any order via jQueryUI.
- Adds drag and drop ordering to Tabular Inline models that inherit from - Adds drag and drop ordering to Tabular and Stacked Inline models that inherit from
SortableTabularInline SortableTabularInline and SortableStackedInline
- Allows ordering of objects that are sorted on a Foreign Key, and adds ordering - Allows ordering of objects that are sorted on a Foreign Key, and adds ordering
to the foreign key object if it also inherits from Sortable. to the foreign key object if it also inherits from Sortable.
Future Future
------ ------
- Support for foreign keys that are self referential - Support for foreign keys that are self referential
- Support for StackedInline
- Support for ForeignKeys that have not been previously defined - Support for ForeignKeys that have not been previously defined
- More unit tests
Requirements Requirements
============= =============