Skip to content

Commit

Permalink
Add new fields in Dref Operational Update
Browse files Browse the repository at this point in the history
  • Loading branch information
susilnem committed Mar 4, 2024
1 parent 57b5af0 commit c7264ed
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 1 deletion.
118 changes: 118 additions & 0 deletions dref/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,12 @@ class DrefOperationalUpdate(models.Model):
photos = models.ManyToManyField(
"DrefFile", blank=True, verbose_name=_("images"), related_name="photos_dref_operational_update"
)
other_actor_file = models.ManyToManyField(
"DrefFile",
blank=True,
verbose_name=_("Other Actor file"),
related_name="dref_operational_update_other_actor_file",
)
operational_update_number = models.IntegerField(verbose_name=_("Operational Update Number"), null=True, blank=True)
reporting_timeframe = models.DateField(verbose_name=_("Reporting Timeframe"), null=True, blank=True)
update_date = models.DateField(
Expand Down Expand Up @@ -963,6 +969,20 @@ class DrefOperationalUpdate(models.Model):
ifrc_emergency_phone_number = models.CharField(
verbose_name=_("ifrc emergency phone number"), max_length=100, null=True, blank=True
)
ifrc_anticipatory_name = models.CharField(verbose_name=_("ifrc focal point for anticipatory name"), max_length=255, null=True, blank=True)
ifrc_anticipatory_email = models.CharField(verbose_name=_("ifrc focal point for anticipatory email"), max_length=255, null=True, blank=True)
ifrc_anticipatory_title = models.CharField(
verbose_name=_("ifrc focal point for anticipatory title"),
max_length=255,
null=True,
blank=True
)
ifrc_anticipatory_phone_number = models.CharField(
verbose_name=_("ifrc focal point for anticipatory phone number"),
max_length=100,
null=True,
blank=True
)
regional_focal_point_name = models.CharField(
verbose_name=_("regional focal point name"), max_length=255, null=True, blank=True
)
Expand Down Expand Up @@ -1012,9 +1032,32 @@ class DrefOperationalUpdate(models.Model):
)
needs_identified = models.ManyToManyField(IdentifiedNeed, verbose_name=_("needs identified"), blank=True)
people_assisted = models.TextField(verbose_name=_("people assisted"), blank=True, null=True)
targeting_population_early_action = models.TextField(
verbose_name=_("Targeting of population at risk for the early actions"),
blank=True,
null=True,
)
targeting_expected_impacted_population = models.TextField(
verbose_name=_("targeting expected impacted population"),
blank=True,
null=True,
help_text=_("Targeting of the expected impacted population if the disaster materialises for the immediate response activities."),
)
selection_criteria = models.TextField(
verbose_name=_("selection criteria"), blank=True, null=True, help_text=_("Selection criteria for affected people")
)
selection_criteria_early_action = models.TextField(
verbose_name=_("selection criteria for early action"),
blank=True,
null=True,
help_text=_("For population at risk for the early actions")
)
selection_criteria_expected_impacted_population = models.TextField(
verbose_name=_("selection criteria for expected impacted population"),
blank=True,
null=True,
help_text=_("For the expected impacted population if the hazard materialises for the immediate response activities")
)
community_involved = models.TextField(
verbose_name=_("community involved"),
blank=True,
Expand All @@ -1027,6 +1070,7 @@ class DrefOperationalUpdate(models.Model):
null=True,
help_text=_("Protection, gender, Inclusion affected in this process"),
)
# @Note: Early action activities starts from here
women = models.IntegerField(verbose_name=_("women"), blank=True, null=True)
men = models.IntegerField(verbose_name=_("men"), blank=True, null=True)
girls = models.IntegerField(verbose_name=_("girls"), help_text=_("Girls under 18"), blank=True, null=True)
Expand All @@ -1053,6 +1097,40 @@ class DrefOperationalUpdate(models.Model):
verbose_name=_("people targeted with early actions"), blank=True, null=True
)
displaced_people = models.IntegerField(verbose_name=_("displaced people"), blank=True, null=True)
#Early action activities ends here
# @Note: Immediate response activities starts from here
immediate_women = models.IntegerField(verbose_name=_("women"), blank=True, null=True)
immediate_men = models.IntegerField(verbose_name=_("men"), blank=True, null=True)
immediate_girls = models.IntegerField(verbose_name=_("girls"), help_text=_("Girls under 18"), blank=True, null=True)
immediate_boys = models.IntegerField(verbose_name=_("boys"), help_text=_("Boys under 18"), blank=True, null=True)
immediate_total_targeted_population = models.IntegerField(
verbose_name=_("total targeted population for immediate response"),
help_text=_("Estimated number of targeted people"),
blank=True,
null=True,
)
immediate_disability_people_per = models.FloatField(
verbose_name=_("disability people for immediate response"),
help_text=_("Estimated % people disability for immediate response"),
blank=True,
null=True,
)
immediate_people_per_urban = models.FloatField(
verbose_name=_("people per urban for immediate response"),
help_text=_("Estimated % people Urban for immediate response"),
blank=True,
null=True,
)
immediate_people_per_local = models.FloatField(
verbose_name=_("people per local for immediate response"),
help_text=_("Estimated % people Rural for immediate response"),
blank=True,
null=True,
)
immediate_displaced_people = models.IntegerField(
verbose_name=_("displaced people for immediate response"), help_text=_("Estimated number of displaced people for immediate response"), blank=True, null=True
)
#Immediate response activities ends here
operation_objective = models.TextField(
verbose_name=_("operation objective"),
blank=True,
Expand All @@ -1063,6 +1141,46 @@ class DrefOperationalUpdate(models.Model):
blank=True,
null=True,
)
threshold_for_early_action = models.TextField(
verbose_name=_("threshold for early action"),
blank=True,
null=True,
)
lead_time_for_early_action = models.TextField(
verbose_name=_("lead time for early action"),
blank=True,
null=True,
)
ns_mandate = models.TextField(
verbose_name=_("Does the NS have the mandate?"),
help_text=_("Does the National Society have the mandate to act before the impact of the hazard?"),
blank=True,
null=True
)
ns_eaps = models.TextField(
verbose_name=_("Does the NS have EAPS?"),
help_text=_("Does the National Society have EAPs or simplified EAPs active, triggered or under development?"),
blank=True,
null=True
)
ns_mitigating_measures = models.TextField(
verbose_name=_("Does the NS have mitigating measures?"),
help_text=_("Is the National Society implementing other mitigating measures through other sources of funds"),
blank=True,
null=True
)
ns_disaster_risk_reduction = models.TextField(
verbose_name=_("Has the National Society implemented disaster Risk Reduction activities?"),
help_text=_("Has the National Society implemented relevant Disaster Risk Reduction activities in the same geographical area that this plan builds upon?"),
blank=True,
null=True
)
any_other_actor = models.TextField(
verbose_name=_("Actor in country activated early action protocol?"),
help_text=_("Has any other actor in the country activated an early action protocol?"),
blank=True,
null=True
)
planned_interventions = models.ManyToManyField(PlannedIntervention, verbose_name=_("planned intervention"), blank=True)
is_published = models.BooleanField(
default=False,
Expand Down
3 changes: 2 additions & 1 deletion dref/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,12 @@ class DrefOperationalUpdateSerializer(NestedUpdateMixin, NestedCreateMixin, Mode
created_by_details = UserNameSerializer(source="created_by", read_only=True)
users_details = UserNameSerializer(source="users", many=True, read_only=True)
source_information = SourceInformationSerializer(many=True, required=False)
other_actor_file_details = DrefFileSerializer(many=True, required=False, allow_null=True, source="other_actor_file")

class Meta:
model = DrefOperationalUpdate
read_only_fields = ("operational_update_number", "modified_by", "created_by")
exclude = ("images", "photos", "event_map", "cover_image", "users")
exclude = ("images", "photos", "event_map", "cover_image", "users", "other_actor_file")

def validate(self, data):
dref = data.get("dref")
Expand Down

0 comments on commit c7264ed

Please sign in to comment.