Skip to content

Commit

Permalink
Add fields for hazard-related questions and guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
sudan45 authored and susilnem committed Jan 8, 2025
1 parent e70c76f commit 77d0b87
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
28 changes: 28 additions & 0 deletions dref/migrations/0079_dref_hazard_date_and_location_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.17 on 2025-01-06 09:41

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("dref", "0078_alter_dref_proposed_action_and_more"),
]

operations = [
migrations.AddField(
model_name="dref",
name="hazard_date_and_location",
field=models.CharField(blank=True, max_length=255, null=True, verbose_name="Hazard Date and Location"),
),
migrations.AddField(
model_name="dref",
name="hazard_vulnerabilities_and_risks",
field=models.TextField(blank=True, null=True, verbose_name="Hazard Vulnerabilities and Risks"),
),
migrations.AddField(
model_name="drefoperationalupdate",
name="addressed_humanitarian_impacts",
field=models.TextField(blank=True, null=True, verbose_name="Addressed Humanitarian Impacts"),
),
]
16 changes: 16 additions & 0 deletions dref/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,17 @@ class Status(models.IntegerChoices):
surge_deployment = models.IntegerField(verbose_name=_("Surge Deployment"), null=True, blank=True)
indirect_cost = models.IntegerField(verbose_name=_("Indirect Cost"), null=True, blank=True)
total = models.IntegerField(verbose_name=_("Total"), null=True, blank=True)
hazard_date_and_location = models.CharField(
verbose_name=_("Hazard Date and Location"),
max_length=255,
null=True,
blank=True,
)
hazard_vulnerabilities_and_risks = models.TextField(
verbose_name=_("Hazard Vulnerabilities and Risks"),
null=True,
blank=True,
)

class Meta:
verbose_name = _("dref")
Expand Down Expand Up @@ -1049,6 +1060,11 @@ class DrefOperationalUpdate(models.Model):
surge_deployment = models.IntegerField(verbose_name=_("Surge Deployment"), null=True, blank=True)
indirect_cost = models.IntegerField(verbose_name=_("Indirect Cost"), null=True, blank=True)
total = models.IntegerField(verbose_name=_("Total"), null=True, blank=True)
addressed_humanitarian_impacts = models.TextField(
verbose_name=_("Addressed Humanitarian Impacts"),
null=True,
blank=True,
)
__budget_file_id = None

class Meta:
Expand Down
4 changes: 4 additions & 0 deletions dref/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Meta:
"status",
"status_display",
"date_of_approval",
"addressed_humanitarian_impacts",
]

def get_application_type(self, obj) -> str:
Expand Down Expand Up @@ -386,6 +387,8 @@ class DrefSerializer(NestedUpdateMixin, NestedCreateMixin, ModelSerializer):
surge_deployment = serializers.IntegerField(required=False)
indirect_cost = serializers.IntegerField(required=False)
total = serializers.IntegerField(required=False)
hazard_date_and_location = serializers.CharField(required=False)
hazard_vulnerabilities_and_risks = serializers.CharField(required=False)

class Meta:
model = Dref
Expand Down Expand Up @@ -610,6 +613,7 @@ class DrefOperationalUpdateSerializer(NestedUpdateMixin, NestedCreateMixin, Mode
surge_deployment = serializers.IntegerField(required=False)
indirect_cost = serializers.IntegerField(required=False)
total = serializers.IntegerField(required=False)
addressed_humanitarian_impacts = serializers.CharField(required=False)

class Meta:
model = DrefOperationalUpdate
Expand Down

0 comments on commit 77d0b87

Please sign in to comment.