2015-03-10 02:24:40 +00:00
|
|
|
from django.contrib import admin
|
2015-03-10 04:14:17 +00:00
|
|
|
from orderable.admin import OrderableAdmin
|
2015-03-10 02:24:40 +00:00
|
|
|
|
2015-03-10 04:14:17 +00:00
|
|
|
from project.models import Project, DueDate, Category
|
2015-03-10 02:24:40 +00:00
|
|
|
# Register your models here.
|
2015-03-10 04:14:17 +00:00
|
|
|
|
|
|
|
class DueDateInline(admin.TabularInline):
|
|
|
|
model = DueDate
|
2015-03-10 04:28:57 +00:00
|
|
|
extra = 1
|
|
|
|
|
2015-03-10 04:14:17 +00:00
|
|
|
|
|
|
|
class CategoryClass(OrderableAdmin):
|
|
|
|
list_display = ('__unicode__', 'sort_order_display')
|
|
|
|
|
|
|
|
class ProjectAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ('title','description','status')
|
|
|
|
fields = ['title','description','status']
|
|
|
|
inlines = (DueDateInline,)
|
|
|
|
|
2015-03-10 04:28:57 +00:00
|
|
|
|
|
|
|
class DueDateClass(admin.ModelAdmin):
|
|
|
|
list_display = ('__unicode__', 'project', 'due', 'completed')
|
|
|
|
|
|
|
|
|
2015-03-10 04:14:17 +00:00
|
|
|
admin.site.register(Project, ProjectAdmin)
|
2015-03-10 04:28:57 +00:00
|
|
|
admin.site.register(DueDate, DueDateClass)
|
2015-03-10 04:14:17 +00:00
|
|
|
admin.site.register(Category, CategoryClass)
|