-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proposed action fields and validation #2371
Merged
Rup-Narayan-Rajbanshi
merged 9 commits into
project/dref-imminent
from
feature/remove-dref-imminent-fields
Jan 28, 2025
+373
−5
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e70c76f
Add proposed action fields and validation
sudan45 77d0b87
Add fields for hazard-related questions and guidance
sudan45 924a7be
Add new fields and supporting files in dref application
susilnem 2b210e8
Add changes on purposed action and fix test cases
susilnem 60a0368
Remove unused fields from dreffinal and operational serializer
susilnem ced711c
Change activities to activity
susilnem 7de1aeb
Add validation check for the surge deployment
susilnem 7f21b6b
Add test cases for dref imminent and purposed_action
susilnem e265c44
Add validation for budget and update test cases
susilnem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
dref/migrations/0076_dref_addressed_humanitarian_impacts_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Generated by Django 4.2.16 on 2025-01-22 06:19 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("deployments", "0090_sectortag_title_ar_sectortag_title_en_and_more"), | ||
("dref", "0075_alter_dref_budget_file_preview_alter_dreffile_file_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="dref", | ||
name="addressed_humanitarian_impacts", | ||
field=models.TextField( | ||
blank=True, | ||
help_text=" Which of the expected severe humanitarian impacts of the hazard are your actions addressing?", | ||
null=True, | ||
verbose_name="Addressed Humanitarian Impacts", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="contingency_plans_supporting_document", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="dref_contingency_plans_supporting_document", | ||
to="dref.dreffile", | ||
verbose_name="Contingency Plans Supporting Document", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="hazard_date_and_location", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="When and where is the hazard expected to happen?", | ||
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, | ||
help_text="Explain the underlying vulnerabilities and risks the hazard poses for at-risk communities?", | ||
null=True, | ||
verbose_name="Hazard Vulnerabilities and Risks", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="indirect_cost", | ||
field=models.PositiveIntegerField(blank=True, null=True, verbose_name="Indirect Cost"), | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="scenario_analysis_supporting_document", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="dref_scenario_supporting_document", | ||
to="dref.dreffile", | ||
verbose_name="Scenario Analysis Supporting Document", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="sub_total", | ||
field=models.PositiveIntegerField(blank=True, null=True, verbose_name="Sub total"), | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="surge_deployment_cost", | ||
field=models.PositiveIntegerField(blank=True, null=True, verbose_name="Surge Deployment Cost"), | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="total", | ||
field=models.PositiveIntegerField(blank=True, null=True, verbose_name="Total"), | ||
), | ||
migrations.CreateModel( | ||
name="ProposedAction", | ||
fields=[ | ||
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
( | ||
"proposed_type", | ||
models.PositiveIntegerField( | ||
choices=[(1, "Early Actions"), (2, "Early Response")], verbose_name="dref proposed action" | ||
), | ||
), | ||
("budget", models.PositiveIntegerField(blank=True, null=True, verbose_name="Purpose Action Budgets")), | ||
("activity", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="deployments.sector")), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="dref", | ||
name="proposed_action", | ||
field=models.ManyToManyField(blank=True, to="dref.proposedaction", verbose_name="Proposed Action"), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make it clear about
total
variable weather it istotal_cost
or something else. Same for other variable.. likeexpected_total
, etc, Also update the validationError after renaming the respective variable.