Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load data dictionary case properties in chunks #34827

Merged
merged 18 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions corehq/apps/data_dictionary/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,22 @@ def data_dictionary_json_case_properties(request, domain, case_type_name):
"properties": []
})

# properties_queryset skips groups with no properties. Add them here
empty_groups = (
CasePropertyGroup.objects
.annotate(properties_count=Count('property'))
zandre-eng marked this conversation as resolved.
Show resolved Hide resolved
.filter(case_type=case_type)
.filter(properties_count=0)
)
for group in empty_groups:
case_type_data["groups"].append({
"id": group.id,
"name": group.name,
"description": group.description,
"deprecated": group.deprecated,
"properties": []
})

return JsonResponse(case_type_data)


Expand Down