mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-13 01:57:08 +01:00
Rework how slugs are generated/referenced #393
This commit is contained in:
parent
c7f4bfe4f3
commit
5c3cb1e4ab
4 changed files with 80 additions and 5 deletions
|
|
@ -125,6 +125,8 @@ class CorrespondentAdmin(CommonAdmin):
|
|||
list_filter = ("matching_algorithm",)
|
||||
list_editable = ("match", "matching_algorithm")
|
||||
|
||||
readonly_fields = ("slug",)
|
||||
|
||||
def get_queryset(self, request):
|
||||
qs = super(CorrespondentAdmin, self).get_queryset(request)
|
||||
qs = qs.annotate(
|
||||
|
|
@ -149,6 +151,8 @@ class TagAdmin(CommonAdmin):
|
|||
list_filter = ("colour", "matching_algorithm")
|
||||
list_editable = ("colour", "match", "matching_algorithm")
|
||||
|
||||
readonly_fields = ("slug",)
|
||||
|
||||
def get_queryset(self, request):
|
||||
qs = super(TagAdmin, self).get_queryset(request)
|
||||
qs = qs.annotate(document_count=models.Count("documents"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue