Skip to content

Commit b9d797c

Browse files
authored
Merge remote-tracking branch 'origin/main' into HEA-1083/Add_other_livestock_production_strategy_type
2 parents 11da0e5 + d32d220 commit b9d797c

4 files changed

Lines changed: 39 additions & 2 deletions

File tree

apps/baseline/viewsets.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,11 @@ class LivelihoodActivitySummaryViewSet(AggregatingViewSet):
19021902
percentage_kcals_sum_slice
19031903
percentage_kcals_sum_slice_percentage_of_row
19041904
1905+
The slice_percentage_of_row fields represent the percentage of the total row value that is contributed by the
1906+
slice. Note that if the slice field (product or strategy type) is also included in the &fields parameter, then the
1907+
slice_percentage_of_row values will either be 0 or 100%, depending on whether the value for that field in this
1908+
row matches the slice.
1909+
19051910
You can filter by any calculated slice or row aggregate by prefixing its name with `min_` or `max_`. For example:
19061911
19071912
&min_income_sum_slice_percentage_of_row=52
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Generated by Django 5.2.14 on 2026-05-28 15:46
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("metadata", "0017_seasonalactivitytype_has_product_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="seasonalactivitytype",
15+
name="activity_category",
16+
field=models.CharField(
17+
choices=[
18+
("climatology", "Climatology"),
19+
("stress_period", "Stress Periods"),
20+
("crop", "Crops"),
21+
("livestock", "Livestock"),
22+
("fishing", "Fishing"),
23+
("other_income", "Employment and Other Income"),
24+
("other", "Other"),
25+
],
26+
max_length=20,
27+
verbose_name="Activity Category",
28+
),
29+
),
30+
]

apps/metadata/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ class SeasonalActivityType(ReferenceData):
227227
"""
228228

229229
class SeasonalActivityCategory(models.TextChoices):
230-
SEASON = "season", _("Season")
230+
CLIMATOLOGY = "climatology", _("Climatology")
231+
STRESS_PERIODS = "stress_period", _("Stress Periods")
231232
CROP = "crop", _("Crops")
232233
LIVESTOCK = "livestock", _("Livestock")
233234
FISHING = "fishing", _("Fishing")
235+
OTHER_INCOME = "other_income", _("Employment and Other Income")
234236
OTHER = "other", _("Other")
235237

236238
activity_category = models.CharField(

apps/metadata/tests/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Meta:
118118
code = factory.Iterator(["AC1", "AC2", "AC3", "AC4"])
119119
activity_category = factory.Iterator(
120120
[
121-
SeasonalActivityType.SeasonalActivityCategory.SEASON,
121+
SeasonalActivityType.SeasonalActivityCategory.CLIMATOLOGY,
122122
SeasonalActivityType.SeasonalActivityCategory.CROP,
123123
SeasonalActivityType.SeasonalActivityCategory.LIVESTOCK,
124124
SeasonalActivityType.SeasonalActivityCategory.OTHER,

0 commit comments

Comments
 (0)