Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #375 from elohmeier/document-count
Browse files Browse the repository at this point in the history
add document count column for tags and correspondents
  • Loading branch information
danielquinn authored Jul 8, 2018
2 parents f99db14 + 2894d10 commit 04816f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/documents/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,24 @@ class CommonAdmin(admin.ModelAdmin):

class CorrespondentAdmin(CommonAdmin):

list_display = ("name", "match", "matching_algorithm")
list_display = ("name", "match", "matching_algorithm", "document_count")
list_filter = ("matching_algorithm",)
list_editable = ("match", "matching_algorithm")

def document_count(self, obj):
return obj.documents.count()


class TagAdmin(CommonAdmin):

list_display = ("name", "colour", "match", "matching_algorithm")
list_display = ("name", "colour", "match", "matching_algorithm",
"document_count")
list_filter = ("colour", "matching_algorithm")
list_editable = ("colour", "match", "matching_algorithm")

def document_count(self, obj):
return obj.documents.count()


class DocumentAdmin(CommonAdmin):

Expand Down

0 comments on commit 04816f5

Please sign in to comment.