-
Notifications
You must be signed in to change notification settings - Fork 9
Emergency pages: Add new model and register for translation. #2767
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
base: project/dref-emergency-pages
Are you sure you want to change the base?
Changes from all commits
c365755
92e45d9
4f48f43
fb932a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Generated by Django 4.2.30 on 2026-06-22 05:01 | ||
|
|
||
| from django.db import migrations, models | ||
| import django.db.models.deletion | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('dref', '0089_remove_dref_field_report_dref_event'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name='DrefSummary', | ||
| fields=[ | ||
| ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
| ('created_at', models.DateTimeField(auto_now_add=True)), | ||
| ('updated_at', models.DateTimeField(auto_now=True)), | ||
| ('hash', models.CharField(max_length=64, unique=True)), | ||
| ('situational_overview', models.TextField(blank=True, null=True)), | ||
| ('operational_strategy', models.TextField(blank=True, null=True)), | ||
| ('people_centered_approach', models.TextField(blank=True, null=True)), | ||
| ('challenges_identified', models.TextField(blank=True, null=True)), | ||
| ('lessons_learned', models.TextField(blank=True, null=True)), | ||
| ('status', models.IntegerField(choices=[(100, 'Pending'), (200, 'Success'), (300, 'Failed')], default=100)), | ||
| ('dref', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='summary', to='dref.dref')), | ||
| ], | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| # Generated by Django 4.2.30 on 2026-06-22 08:40 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('dref', '0090_drefsummary'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='challenges_identified_ar', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='challenges_identified_en', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='challenges_identified_es', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='challenges_identified_fr', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='lessons_learned_ar', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='lessons_learned_en', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='lessons_learned_es', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='lessons_learned_fr', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='operational_strategy_ar', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='operational_strategy_en', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='operational_strategy_es', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='operational_strategy_fr', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='people_centered_approach_ar', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='people_centered_approach_en', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='people_centered_approach_es', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='people_centered_approach_fr', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='situational_overview_ar', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='situational_overview_en', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='situational_overview_es', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='situational_overview_fr', | ||
| field=models.TextField(blank=True, null=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='translation_module_original_language', | ||
| field=models.CharField(choices=[('en', 'English'), ('es', 'Spanish'), ('fr', 'French'), ('ar', 'Arabic')], default='en', help_text='Language used to create this entity', max_length=2, verbose_name='Entity Original language'), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='drefsummary', | ||
| name='translation_module_skip_auto_translation', | ||
| field=models.BooleanField(default=False, help_text='Skip auto translation operation for this entity?', verbose_name='Skip auto translation'), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1700,3 +1700,55 @@ def get_for(user, status=None): | |||||||||||||||||||
| if status == Dref.Status.APPROVED: | ||||||||||||||||||||
| return queryset.filter(status=Dref.Status.APPROVED) | ||||||||||||||||||||
| return queryset | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| class DrefSummary(models.Model): | ||||||||||||||||||||
|
|
||||||||||||||||||||
| class SummaryStatus(models.IntegerChoices): | ||||||||||||||||||||
| PENDING = 100, _("Pending") | ||||||||||||||||||||
| SUCCESS = 200, _("Success") | ||||||||||||||||||||
| FAILED = 300, _("Failed") | ||||||||||||||||||||
|
Comment on lines
+1707
to
+1710
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's also add Processing status too. Here!
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| dref = models.OneToOneField( | ||||||||||||||||||||
| Dref, | ||||||||||||||||||||
| on_delete=models.CASCADE, | ||||||||||||||||||||
| related_name="summary", | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| created_at = models.DateTimeField(auto_now_add=True) | ||||||||||||||||||||
| updated_at = models.DateTimeField(auto_now=True) | ||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this? |
||||||||||||||||||||
|
|
||||||||||||||||||||
| hash = models.CharField( | ||||||||||||||||||||
| max_length=64, | ||||||||||||||||||||
| unique=True, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
Comment on lines
+1721
to
+1724
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| situational_overview = models.TextField( | ||||||||||||||||||||
| blank=True, | ||||||||||||||||||||
| null=True, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| operational_strategy = models.TextField( | ||||||||||||||||||||
| blank=True, | ||||||||||||||||||||
| null=True, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| people_centered_approach = models.TextField( | ||||||||||||||||||||
| blank=True, | ||||||||||||||||||||
| null=True, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| challenges_identified = models.TextField( | ||||||||||||||||||||
| blank=True, | ||||||||||||||||||||
| null=True, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| lessons_learned = models.TextField( | ||||||||||||||||||||
| blank=True, | ||||||||||||||||||||
| null=True, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| status = models.IntegerField( | ||||||||||||||||||||
| choices=SummaryStatus.choices, | ||||||||||||||||||||
| default=SummaryStatus.PENDING, | ||||||||||||||||||||
| ) | ||||||||||||||||||||
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.
Let's merge this Migrations!