2013-03-11 00:53:05 +00:00
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
|
|
from adminsortable.admin import (SortableAdmin, SortableTabularInline,
|
2013-03-15 09:10:01 +00:00
|
|
|
SortableStackedInline, SortableGenericStackedInline)
|
|
|
|
|
from app.models import Category, Project, Credit, Note, GenericNote
|
2013-03-11 00:53:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(Category, SortableAdmin)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CreditInline(SortableTabularInline):
|
|
|
|
|
model = Credit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NoteInline(SortableStackedInline):
|
|
|
|
|
model = Note
|
|
|
|
|
extra = 0
|
|
|
|
|
|
|
|
|
|
|
2013-03-15 09:10:01 +00:00
|
|
|
class GenericNoteInline(SortableGenericStackedInline):
|
|
|
|
|
model = GenericNote
|
|
|
|
|
extra = 0
|
|
|
|
|
|
|
|
|
|
|
2013-03-11 00:53:05 +00:00
|
|
|
class ProjectAdmin(SortableAdmin):
|
2013-03-15 09:10:01 +00:00
|
|
|
inlines = [CreditInline, NoteInline, GenericNoteInline]
|
2013-03-11 00:53:05 +00:00
|
|
|
list_display = ['__unicode__', 'category']
|
|
|
|
|
|
|
|
|
|
admin.site.register(Project, ProjectAdmin)
|