Feature: custom fields filtering & bulk editing (#6484)

This commit is contained in:
shamoon
2024-04-26 15:10:03 -07:00
committed by GitHub
parent bd4476d484
commit 63e1f9f5d3
28 changed files with 1563 additions and 323 deletions

View File

@@ -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
],
},
)