mirror of
https://github.com/jazzband/django-admin-sortable.git
synced 2026-04-17 21:31:05 +00:00
19 lines
438 B
Python
19 lines
438 B
Python
|
|
from django.contrib import admin
|
||
|
|
|
||
|
|
from adminsortable.admin import SortableAdmin, SortableTabularInline
|
||
|
|
from app.models import Category, Project, Credit
|
||
|
|
|
||
|
|
|
||
|
|
admin.site.register(Category, SortableAdmin)
|
||
|
|
|
||
|
|
|
||
|
|
class CreditInline(SortableTabularInline):
|
||
|
|
model = Credit
|
||
|
|
|
||
|
|
|
||
|
|
class ProjectAdmin(SortableAdmin):
|
||
|
|
inlines = [CreditInline]
|
||
|
|
list_display = ['__unicode__', 'category']
|
||
|
|
|
||
|
|
admin.site.register(Project, ProjectAdmin)
|