mirror of
https://github.com/jazzband/django-admin-sortable.git
synced 2026-03-20 07:50:34 +00:00
Added new sample project. Improved documentation. Refactored CSS selector for inlines that are sortable.
24 lines
541 B
Python
24 lines
541 B
Python
from django.contrib import admin
|
|
|
|
from adminsortable.admin import (SortableAdmin, SortableTabularInline,
|
|
SortableStackedInline)
|
|
from app.models import Category, Project, Credit, Note
|
|
|
|
|
|
admin.site.register(Category, SortableAdmin)
|
|
|
|
|
|
class CreditInline(SortableTabularInline):
|
|
model = Credit
|
|
|
|
|
|
class NoteInline(SortableStackedInline):
|
|
model = Note
|
|
extra = 0
|
|
|
|
|
|
class ProjectAdmin(SortableAdmin):
|
|
inlines = [CreditInline, NoteInline]
|
|
list_display = ['__unicode__', 'category']
|
|
|
|
admin.site.register(Project, ProjectAdmin)
|