Skip to content

Commit b4cf9e2

Browse files
authored
Merge pull request #269 from American-Institutes-for-Research/HEA-996/quick_fix_on_perf_after_ordering
Temp fix for the ordering as perf is affected by it see HEA-996
2 parents 58eadfb + 5d66592 commit b4cf9e2

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

apps/baseline/viewsets.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,9 @@ class WealthGroupViewSet(BaseModelViewSet):
419419
serializer_class = WealthGroupSerializer
420420
filterset_class = WealthGroupFilterSet
421421
ordering = [
422-
"livelihood_zone_baseline__livelihood_zone__code",
423-
"livelihood_zone_baseline__reference_year_end_date",
422+
"livelihood_zone_baseline",
424423
"wealth_group_category__ordering",
425-
"community__name",
424+
"community",
426425
]
427426

428427

@@ -874,21 +873,23 @@ class LivelihoodStrategyViewSet(BaseModelViewSet):
874873
)
875874
serializer_class = LivelihoodStrategySerializer
876875
filterset_class = LivelihoodStrategyFilterSet
876+
ordering = [
877+
"livelihood_zone_baseline",
878+
"strategy_type",
879+
"season",
880+
"product",
881+
"additional_identifier",
882+
]
877883
search_fields = [
878884
"additional_identifier",
879885
"strategy_type",
880886
]
881887

882888

883889
LIVELIHOOD_ACTIVITY_ORDER_BY = [
884-
"livelihood_zone_baseline__livelihood_zone__code",
885-
"livelihood_zone_baseline__reference_year_end_date",
886-
"wealth_group__wealth_group_category__code",
890+
"livelihood_zone_baseline",
891+
"wealth_group",
887892
"strategy_type",
888-
"livelihood_strategy__season__name_en",
889-
"livelihood_strategy__product_id",
890-
"livelihood_strategy__additional_identifier",
891-
"wealth_group__community__full_name",
892893
"scenario",
893894
]
894895

0 commit comments

Comments
 (0)