Prefetch to reduce hits

This commit is contained in:
Oliver Walters committed 2025-11-25 04:18:50 +00:00
1 parent b86bc2d6b8
commit a617cece72
1 file changed
+2
+2
View File
@@ -832,6 +832,8 @@ class ParameterTemplateFilter(FilterSet):
if not content_type:
return queryset.none()
queryset = queryset.prefetch_related('parameters')
# Annotate the queryset to determine which ParameterTemplates have at least one Parameter for the given model type
queryset = queryset.annotate(
parameter_count=SubqueryCount(