588825332f
I took the serializers and put them in their own file. I made the due dates be attached to the project with a foreign key, rather than M2M, better admin inline.
20 lines
603 B
Python
20 lines
603 B
Python
from django.contrib import admin
|
|
from orderable.admin import OrderableAdmin
|
|
|
|
from project.models import Project, DueDate, Category
|
|
# Register your models here.
|
|
|
|
class DueDateInline(admin.TabularInline):
|
|
model = DueDate
|
|
|
|
class CategoryClass(OrderableAdmin):
|
|
list_display = ('__unicode__', 'sort_order_display')
|
|
|
|
class ProjectAdmin(admin.ModelAdmin):
|
|
list_display = ('title','description','status')
|
|
fields = ['title','description','status']
|
|
inlines = (DueDateInline,)
|
|
|
|
admin.site.register(Project, ProjectAdmin)
|
|
admin.site.register(DueDate)
|
|
admin.site.register(Category, CategoryClass) |