mirror of
https://github.com/jazzband/django-admin-sortable.git
synced 2026-04-07 00:11:05 +00:00
Added backwards compatibility for pre 1.1.1 versions that still have sortable_by defined as a classmethod. Need to address dynamic regroup template tag to see why categories are not being grouped properly in sample app.
23 lines
595 B
Python
Executable file
23 lines
595 B
Python
Executable file
from django.contrib import admin
|
|
|
|
from adminsortable.admin import SortableAdmin, SortableTabularInline, SortableStackedInline
|
|
from app.models import Category, Project, Credit, Note, Sample
|
|
|
|
|
|
admin.site.register(Category, SortableAdmin)
|
|
|
|
|
|
class CreditInline(SortableTabularInline):
|
|
model = Credit
|
|
|
|
|
|
class NoteInline(SortableStackedInline):
|
|
model = Note
|
|
|
|
|
|
class ProjectAdmin(SortableAdmin):
|
|
inlines = [CreditInline, NoteInline]
|
|
list_display = ['__unicode__', 'category']
|
|
|
|
admin.site.register(Project, ProjectAdmin)
|
|
admin.site.register(Sample, SortableAdmin)
|