Wrestle your django inlines with jQuery and Grappelli.
Project description
django-inline-wrestler
=======================
Make django inline lists easier to sort with jQuery and Grappelli.
This plugin turns an ordinary order field into a high-powered sorting tool including:
* Drag-and-Drop
* Jump to Top and Jump to Bottom buttons
* Jump one up and Jump one bottom
* Send directly to a position in the list
* Adjust table headers so they line up with the actual columns
* Make table headers sortable, so you can sort by a particular field (supports sorting by text inputs, text areas, check boxes, image uploads, and fks)
* Positioning order buttons anywhere in the table
![Screenshot of Django inline items](/../master/docs/screenshots/screenshot.png?raw=true "Screenshot of Tabular Inline Items")
![Screenshot of Django inline items](/../master/docs/screenshots/sort_by_columns.png?raw=true "Screenshot of Tabular Inline Items")
Usage
=====
1. pip install django-inline-wrestler
2. Add 'django-inline-wrestler' to your INSTALLED_APPS list in your project's settings.py
```python
from django_inline_wrestler.admin import TabularInlineOrderable
from .models import *
class ItemInline(TabularInlineOrderable):
model = Item
fields = ('order', 'name', 'txtid', 'description')
prepopulated_fields = {'txtid': ('name',)}
class SubItemInline(TabularInlineOrderable):
model = SubItem
fields = ('position', 'name', 'txtid')
prepopulated_fields = {'txtid': ('name',)}
#To override which field is used for ordering, add a class starting with order-by-[fieldname]. Make sure to also include
classes = ['django-inline-wrestler', 'order-by-position']
```
=======================
Make django inline lists easier to sort with jQuery and Grappelli.
This plugin turns an ordinary order field into a high-powered sorting tool including:
* Drag-and-Drop
* Jump to Top and Jump to Bottom buttons
* Jump one up and Jump one bottom
* Send directly to a position in the list
* Adjust table headers so they line up with the actual columns
* Make table headers sortable, so you can sort by a particular field (supports sorting by text inputs, text areas, check boxes, image uploads, and fks)
* Positioning order buttons anywhere in the table
![Screenshot of Django inline items](/../master/docs/screenshots/screenshot.png?raw=true "Screenshot of Tabular Inline Items")
![Screenshot of Django inline items](/../master/docs/screenshots/sort_by_columns.png?raw=true "Screenshot of Tabular Inline Items")
Usage
=====
1. pip install django-inline-wrestler
2. Add 'django-inline-wrestler' to your INSTALLED_APPS list in your project's settings.py
```python
from django_inline_wrestler.admin import TabularInlineOrderable
from .models import *
class ItemInline(TabularInlineOrderable):
model = Item
fields = ('order', 'name', 'txtid', 'description')
prepopulated_fields = {'txtid': ('name',)}
class SubItemInline(TabularInlineOrderable):
model = SubItem
fields = ('position', 'name', 'txtid')
prepopulated_fields = {'txtid': ('name',)}
#To override which field is used for ordering, add a class starting with order-by-[fieldname]. Make sure to also include
classes = ['django-inline-wrestler', 'order-by-position']
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-inline-wrestler-4.0.tar.gz
.
File metadata
- Download URL: django-inline-wrestler-4.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aae840a1d353cadf3b2910b0b7cfe9fdcc381c279509caacaee24806c7a64ea |
|
MD5 | 8fe8dc48016f9e1d34b0b835c3b8f72a |
|
BLAKE2b-256 | ae4554659c82a1212c0a1d2eeb7013b8e45466828e29fb1522b2bfaa62853ef0 |