diff --git a/project/admin.py b/project/admin.py index f670181..22aaff1 100644 --- a/project/admin.py +++ b/project/admin.py @@ -6,6 +6,8 @@ from project.models import Project, DueDate, Category class DueDateInline(admin.TabularInline): model = DueDate + extra = 1 + class CategoryClass(OrderableAdmin): list_display = ('__unicode__', 'sort_order_display') @@ -15,6 +17,11 @@ class ProjectAdmin(admin.ModelAdmin): fields = ['title','description','status'] inlines = (DueDateInline,) + +class DueDateClass(admin.ModelAdmin): + list_display = ('__unicode__', 'project', 'due', 'completed') + + admin.site.register(Project, ProjectAdmin) -admin.site.register(DueDate) +admin.site.register(DueDate, DueDateClass) admin.site.register(Category, CategoryClass) \ No newline at end of file diff --git a/project/models.py b/project/models.py index 52fd6e2..1b53982 100644 --- a/project/models.py +++ b/project/models.py @@ -18,6 +18,9 @@ class Project(models.Model): created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) + def __unicode__(self): + return self.title + class Category(Orderable): title = models.CharField(max_length=256)