mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-12 00:19:48 +00:00
Feature: custom fields filtering & bulk editing (#6484)
This commit is contained in:
@@ -1065,6 +1065,18 @@ class SelectionDataView(GenericAPIView):
|
||||
),
|
||||
)
|
||||
|
||||
custom_fields = CustomField.objects.annotate(
|
||||
document_count=Count(
|
||||
Case(
|
||||
When(
|
||||
fields__document__id__in=ids,
|
||||
then=1,
|
||||
),
|
||||
output_field=IntegerField(),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
r = Response(
|
||||
{
|
||||
"selected_correspondents": [
|
||||
@@ -1081,6 +1093,10 @@ class SelectionDataView(GenericAPIView):
|
||||
{"id": t.id, "document_count": t.document_count}
|
||||
for t in storage_paths
|
||||
],
|
||||
"selected_custom_fields": [
|
||||
{"id": t.id, "document_count": t.document_count}
|
||||
for t in custom_fields
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user