mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-14 00:26:21 +00:00
Merge branch 'master' into workflow-improvements
This commit is contained in:
@@ -110,7 +110,7 @@ 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")
|
||||
|
||||
@@ -122,9 +122,14 @@ class CorrespondentAdmin(CommonAdmin):
|
||||
document.correspondent = obj
|
||||
document.save(update_fields=("correspondent",))
|
||||
|
||||
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")
|
||||
|
||||
@@ -135,6 +140,9 @@ class TagAdmin(CommonAdmin):
|
||||
if obj.matches(document.content):
|
||||
document.tags.add(obj)
|
||||
|
||||
def document_count(self, obj):
|
||||
return obj.documents.count()
|
||||
|
||||
|
||||
def add_tag_to_selected(modeladmin, request, queryset):
|
||||
opts = modeladmin.model._meta
|
||||
|
Reference in New Issue
Block a user