Show more fields in admin

This commit is contained in:
Tyrel Souza 2015-03-10 00:28:57 -04:00
parent 588825332f
commit f9be1484b1
2 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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)