Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/20tab/twentytab-sortable
A django model and admin to create sortable items in django admin with jqueryui sortable method
https://github.com/20tab/twentytab-sortable
Last synced: 21 days ago
JSON representation
A django model and admin to create sortable items in django admin with jqueryui sortable method
- Host: GitHub
- URL: https://github.com/20tab/twentytab-sortable
- Owner: 20tab
- License: mit
- Created: 2014-02-09T17:03:03.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-06T11:24:35.000Z (almost 10 years ago)
- Last Synced: 2024-11-16T01:48:45.868Z (about 1 month ago)
- Language: JavaScript
- Size: 470 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
twentytab-sortable
==================A django model and admin to create sortable items in django admin with jqueryui sortable method
## Installation
Use the following command: pip install twentytab-sortable
## Configuration
- Settings.py
Open settings.py and add sortable to your INSTALLED_APPS:
```py
INSTALLED_APPS = [
...
'sortable',
...
]
```- Static files
Run collectstatic command or map static directory.
## Usage
- models.py```py
from sortable.models import PositionModelclass MyPositionModel(PositionModel):
pass```
- admin.py
```py
from django.contrib import admin
from myapp.models import MyPositionModel
from sortable.admin import PositionAdmin, SortableTabularInline, SortableStackedInlineclass MyTabularInline(SortableTabularInline):
# add 'position' in your fields
model = APositionModelclass MyStackedInline(SortableStackedInline):
# add 'position' in your fields
model = APositionModelclass MyPositionAdmin(PositionAdmin):
inlines = [MyTabularInline, MyStackedInline]
# add 'position' in your list_editable fieldsadmin.site.register(MyPositionModel, MyPositionAdmin)
```