API is halfway there

This commit is contained in:
Daniel Quinn
2016-02-16 09:28:34 +00:00
parent bbe7a02b4d
commit cebc44f2c9
5 changed files with 76 additions and 5 deletions

View File

@@ -46,10 +46,13 @@ class DocumentAdmin(admin.ModelAdmin):
}
search_fields = ("sender__name", "title", "content")
list_display = ("created", "sender", "title", "tags_", "document")
list_display = ("created_", "sender", "title", "tags_", "document")
list_filter = ("tags", "sender", MonthListFilter)
list_per_page = 25
def created_(self, obj):
return obj.created.date().strftime("%Y-%m-%d")
def tags_(self, obj):
r = ""
for tag in obj.tags.all():