Skip to content

Commit

Permalink
Add models for summary tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Rup-Narayan-Rajbanshi committed Jul 4, 2023
1 parent 2740502 commit 706b6c6
Show file tree
Hide file tree
Showing 4 changed files with 263 additions and 18 deletions.
121 changes: 114 additions & 7 deletions apps/assessment_registry/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.17 on 2023-07-03 05:13
# Generated by Django 3.2.17 on 2023-07-04 05:35

from django.conf import settings
import django.contrib.postgres.fields
Expand All @@ -12,12 +12,12 @@ class Migration(migrations.Migration):
initial = True

dependencies = [
('geo', '0041_geoarea_centroid'),
('project', '0003_auto_20230508_0608'),
('organization', '0012_organization_popularity'),
('lead', '0048_auto_20230228_0810'),
('gallery', '0020_merge_0019_auto_20210120_0443_0019_auto_20210503_0431'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('lead', '0048_auto_20230228_0810'),
('geo', '0041_geoarea_centroid'),
('organization', '0012_organization_popularity'),
]

operations = [
Expand Down Expand Up @@ -47,8 +47,8 @@ class Migration(migrations.Migration):
('data_collection_techniques', models.TextField(blank=True, null=True)),
('sampling', models.TextField(blank=True, null=True)),
('limitations', models.TextField(blank=True, null=True)),
('focuses', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Context'), (1, 'Shock/Event'), (2, 'Displacement'), (3, 'Humaniterian Access'), (4, 'Information and Communication'), (5, 'Impact (Scope and Scale)'), (6, 'Humanitarian Conditions'), (7, 'Response and Capacities'), (8, 'Current and Forecasted Priorities'), (9, 'Covid 19 Containment Measures')], null=True), size=None)),
('sectors', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Food'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Child protection'), (9, 'Gender Based Violence')], null=True), size=None)),
('focuses', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Context'), (1, 'Shock/Event'), (2, 'Displacement'), (3, 'Casualties'), (4, 'Information and Communication'), (5, 'Humaniterian Access'), (6, 'Impact'), (7, 'Humanitarian Conditions'), (8, 'People at risk'), (9, 'Priorities & Preferences'), (10, 'Response and Capacities')], null=True), size=None)),
('sectors', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Food Security'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Logistics'), (9, 'Inter/Cross Sector')], null=True), size=None)),
('protection_info_mgmts', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(blank=True, choices=[(0, 'Protection Monitoring'), (1, 'Protection Needs Assessment'), (2, 'Case Management'), (3, 'Population Data'), (4, 'Protection Response M&E'), (5, 'Communicating with(in) Affected Communities'), (6, 'Security & Situational Awareness'), (7, 'Sectoral System/Other')], null=True), size=None)),
('affected_groups', models.IntegerField(blank=True, choices=[(0, 'All'), (1, 'All/Affected'), (2, 'All/Not Affected'), (3, 'All/Affected/Not Displaced'), (4, 'All/Affected/Displaced'), (5, 'All/Affected/Displaced/In Transit'), (6, 'All/Affected/Displaced/Migrants'), (7, 'All/Affected/Displaced/IDPs'), (8, 'All/Affected/Displced/Asylum Seeker'), (9, 'All/Affected/Displaced/Other of concerns'), (10, 'All/Affected/Displaced/Returnees'), (11, 'All/Affected/Displaced/Refugees'), (12, 'All/Affected/Displaced/Migrants/In transit'), (13, 'All/Affected/Displaced/Migrants/Permanents'), (14, 'All/Affected/Displaced/Migrants/Pendular'), (15, 'All/Affected/Not Displaced/No Host'), (16, 'All/Affected/Not Displaced/Host')], null=True)),
('matrix_score', models.IntegerField(default=0)),
Expand All @@ -70,6 +70,113 @@ class Migration(migrations.Migration):
'ordering': ['id'],
},
),
migrations.CreateModel(
name='SummaryIssue',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('sub_sector', models.IntegerField(blank=True, choices=[(0, 'Politics'), (1, 'Demography'), (2, 'Socio-Cultural'), (3, 'Environment'), (4, 'Security & Stability'), (5, 'Economics'), (6, 'Characteristics'), (7, 'Drivers and Aggravating Factors'), (8, 'Mitigating Factors'), (9, 'Hazards & Threats'), (10, 'Push Factors'), (11, 'Pull Factors'), (12, 'Intentions'), (13, 'Local Integrations'), (14, 'Source & Means'), (15, 'Challanges & Barriers'), (16, 'Knowledge & Info Gaps (Humanitarian)'), (17, 'Knowledge & Info Gaps (Population)'), (18, 'Population To Relief'), (19, 'Relief To Population'), (20, 'Physical & Security')])),
('focus_sub_sector', models.IntegerField(blank=True, choices=[(0, 'Drivers'), (1, 'Impact on People'), (2, 'Impact On System, Network And Services'), (3, 'Living Standards'), (4, 'Coping Mechanisms'), (5, 'Physical And Mental Well Being'), (6, 'Needs (Population)'), (7, 'Needs (Humanitarian)'), (8, 'Interventions (Population)'), (9, 'Interventions (Humanitarian)'), (10, 'Demographic Groups'), (11, 'Groups With Specific Needs'), (12, 'Geographical Areas'), (13, 'People At Risks'), (14, 'Focal Issues')])),
('label', models.CharField(max_length=220)),
('full_label', models.CharField(blank=True, max_length=220)),
('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assessment_registry.summaryissue')),
],
),
migrations.CreateModel(
name='SummarySubSectorIssue',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('modified_at', models.DateTimeField(auto_now=True)),
('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)),
('text', models.TextField(blank=True)),
('order', models.IntegerField(blank=True, null=True)),
('lead_preview_text_ref', models.JSONField(blank=True, default=None, null=True)),
('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_sub_sector_issue_ary', to='assessment_registry.assessmentregistry')),
('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summarysubsectorissue_created', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summarysubsectorissue_modified', to=settings.AUTH_USER_MODEL)),
('summary_issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_subsector_issue', to='assessment_registry.summaryissue')),
],
options={
'ordering': ['-created_at'],
'abstract': False,
},
),
migrations.CreateModel(
name='SummaryFocusSubSectorIssue',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('modified_at', models.DateTimeField(auto_now=True)),
('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)),
('focus', models.IntegerField(choices=[(0, 'Food Security'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Logistics'), (9, 'Inter/Cross Sector')])),
('text', models.TextField(blank=True)),
('order', models.IntegerField(blank=True, null=True)),
('lead_preview_text_ref', models.JSONField(blank=True, default=None, null=True)),
('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_focus_subsector_issue_ary', to='assessment_registry.assessmentregistry')),
('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocussubsectorissue_created', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocussubsectorissue_modified', to=settings.AUTH_USER_MODEL)),
('summary_issue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_focus_subsector_issue', to='assessment_registry.summaryissue')),
],
options={
'ordering': ['-created_at'],
'abstract': False,
},
),
migrations.CreateModel(
name='SummaryFocus',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('modified_at', models.DateTimeField(auto_now=True)),
('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)),
('percentage_of_people_affected', models.IntegerField(blank=True, null=True)),
('total_people_affected', models.IntegerField(blank=True, null=True)),
('percentage_of_moderate', models.IntegerField(blank=True, null=True)),
('percentage_of_severe', models.IntegerField(blank=True, null=True)),
('percentage_of_critical', models.IntegerField(blank=True, null=True)),
('percentage_in_need', models.IntegerField(blank=True, null=True)),
('total_moderate', models.IntegerField(blank=True, null=True)),
('total_severe', models.IntegerField(blank=True, null=True)),
('total_critical', models.IntegerField(blank=True, null=True)),
('total_in_need', models.IntegerField(blank=True, null=True)),
('total_pop_assessed', models.IntegerField(blank=True, null=True)),
('total_not_affected', models.IntegerField(blank=True, null=True)),
('total_affected', models.IntegerField(blank=True, null=True)),
('total_people_in_need', models.IntegerField(blank=True, null=True)),
('total_people_moderately_in_need', models.IntegerField(blank=True, null=True)),
('total_people_severly_in_need', models.IntegerField(blank=True, null=True)),
('total_people_critically_in_need', models.IntegerField(blank=True, null=True)),
('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary_focus', to='assessment_registry.assessmentregistry')),
('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocus_created', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summaryfocus_modified', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-created_at'],
'abstract': False,
},
),
migrations.CreateModel(
name='Summary',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('modified_at', models.DateTimeField(auto_now=True)),
('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)),
('total_people_assessed', models.IntegerField(blank=True, null=True)),
('total_dead', models.IntegerField(blank=True, null=True)),
('total_injured', models.IntegerField(blank=True, null=True)),
('total_missing', models.IntegerField(blank=True, null=True)),
('total_people_facing_hum_access_cons', models.IntegerField(blank=True, null=True)),
('percentage_of_people_facing_hum_access_cons', models.IntegerField(blank=True, null=True)),
('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='summary', to='assessment_registry.assessmentregistry')),
('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summary_created', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='summary_modified', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-created_at'],
'abstract': False,
},
),
migrations.CreateModel(
name='Question',
fields=[
Expand Down Expand Up @@ -153,7 +260,7 @@ class Migration(migrations.Migration):
('created_at', models.DateTimeField(auto_now_add=True)),
('modified_at', models.DateTimeField(auto_now=True)),
('client_id', models.CharField(blank=True, default=None, max_length=128, null=True, unique=True)),
('sector', models.IntegerField(choices=[(0, 'Food'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Child protection'), (9, 'Gender Based Violence')])),
('sector', models.IntegerField(choices=[(0, 'Food Security'), (1, 'Heath'), (2, 'Shelter'), (3, 'Wash'), (4, 'Protection'), (5, 'Nutrition'), (6, 'Livelihood'), (7, 'Education'), (8, 'Logistics'), (9, 'Inter/Cross Sector')])),
('value', models.IntegerField(validators=[django.core.validators.MaxValueValidator(49), django.core.validators.MinValueValidator(1)])),
('assessment_registry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='analytical_density', to='assessment_registry.assessmentregistry')),
('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='scoreanalyticaldensity_created', to=settings.AUTH_USER_MODEL)),
Expand Down
Loading

0 comments on commit 706b6c6

Please sign in to comment.