mirror of
https://github.com/jazzband/django-admin-sortable.git
synced 2026-03-26 02:40:29 +00:00
Incremented version to 1.2. Refactored ORM calls to properly order objects by the sortable_by property to ensure objects are grouped correctly in the sortable change list template after being passed through dynamic_regroup. Fixed missing import for jquery.effects.core, again. Refactored sortable_by classmethod into a property.
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)
|