mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Merge pull request #375 from elohmeier/document-count
add document count column for tags and correspondents
This commit is contained in:
		
						commit
						04816f556f
					
				@ -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):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user