optimized unit conversion queries

using filter breaks prefetch related
This commit is contained in:
vabene1111
2023-02-26 08:22:07 +01:00
parent c217bf2445
commit 38010117e5
5 changed files with 113 additions and 45 deletions

View File

@ -805,7 +805,14 @@ class RecipeViewSet(viewsets.ModelViewSet):
'steps__ingredients__food__substitute',
'steps__ingredients__food__child_inherit_fields',
'steps__ingredients__food__foodnutrition_set',
'steps__ingredients__food__foodnutrition_set__food',
'steps__ingredients__food__foodnutrition_set__food_unit',
'steps__ingredients__food__foodnutrition_set__nutrition_type',
'steps__ingredients__unit',
'steps__ingredients__unit__unit_conversion_base_relation',
'steps__ingredients__unit__unit_conversion_base_relation__base_unit',
'steps__ingredients__unit__unit_conversion_converted_relation',
'steps__ingredients__unit__unit_conversion_converted_relation__converted_unit',
'cooklog_set').select_related(
'nutrition')