Skip to content
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

Fix/django models #34

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
# Generated by Django 4.2.3 on 2023-08-11 10:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0016_allprojectperfmetrics_category_and_more'),
]

operations = [
migrations.AddField(
model_name='categorywisematchratios',
name='affected_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='affected_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='affected_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='age_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='age_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='age_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='displaced_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='displaced_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='displaced_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='gender_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='gender_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='gender_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='non_displaced_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='non_displaced_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='non_displaced_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='pillars_1d_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='pillars_1d_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='pillars_1d_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='pillars_2d_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='pillars_2d_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='pillars_2d_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='severity_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='severity_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='severity_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='specific_needs_groups_completely_matched',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='specific_needs_groups_missing',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='categorywisematchratios',
name='specific_needs_groups_wrong',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='affected_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='affected_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='affected_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='age_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='age_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='age_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='displaced_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='displaced_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='displaced_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='gender_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='gender_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='gender_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='non_displaced_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='non_displaced_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='non_displaced_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='pillars_1d_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='pillars_1d_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='pillars_1d_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='pillars_2d_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='pillars_2d_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='pillars_2d_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='severity_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='severity_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='severity_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='specific_needs_groups_completely_matched_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='specific_needs_groups_missing_mean',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='projectwisematchratios',
name='specific_needs_groups_wrong_mean',
field=models.FloatField(blank=True, null=True),
),
]
56 changes: 55 additions & 1 deletion core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,19 +325,46 @@ class AllProjectPerfMetrics(models.Model):
generated_at = models.DateTimeField()

def __str__(self):
return self.categories
return self.category


class CategoryWiseMatchRatios(models.Model):
sectors_completely_matched = models.FloatField(blank=True, null=True)
sectors_missing = models.FloatField(blank=True, null=True)
sectors_wrong = models.FloatField(blank=True, null=True)
pillars_1d_completely_matched = models.FloatField(blank=True, null=True)
pillars_1d_missing = models.FloatField(blank=True, null=True)
pillars_1d_wrong = models.FloatField(blank=True, null=True)
pillars_2d_completely_matched = models.FloatField(blank=True, null=True)
pillars_2d_missing = models.FloatField(blank=True, null=True)
pillars_2d_wrong = models.FloatField(blank=True, null=True)
subpillars_1d_completely_matched = models.FloatField(blank=True, null=True)
subpillars_1d_missing = models.FloatField(blank=True, null=True)
subpillars_1d_wrong = models.FloatField(blank=True, null=True)
subpillars_2d_completely_matched = models.FloatField(blank=True, null=True)
subpillars_2d_missing = models.FloatField(blank=True, null=True)
subpillars_2d_wrong = models.FloatField(blank=True, null=True)
age_completely_matched = models.FloatField(blank=True, null=True)
age_missing = models.FloatField(blank=True, null=True)
age_wrong = models.FloatField(blank=True, null=True)
displaced_completely_matched = models.FloatField(blank=True, null=True)
displaced_missing = models.FloatField(blank=True, null=True)
displaced_wrong = models.FloatField(blank=True, null=True)
gender_completely_matched = models.FloatField(blank=True, null=True)
gender_missing = models.FloatField(blank=True, null=True)
gender_wrong = models.FloatField(blank=True, null=True)
non_displaced_completely_matched = models.FloatField(blank=True, null=True)
non_displaced_missing = models.FloatField(blank=True, null=True)
non_displaced_wrong = models.FloatField(blank=True, null=True)
severity_completely_matched = models.FloatField(blank=True, null=True)
severity_missing = models.FloatField(blank=True, null=True)
severity_wrong = models.FloatField(blank=True, null=True)
specific_needs_groups_completely_matched = models.FloatField(blank=True, null=True)
specific_needs_groups_missing = models.FloatField(blank=True, null=True)
specific_needs_groups_wrong = models.FloatField(blank=True, null=True)
affected_completely_matched = models.FloatField(blank=True, null=True)
affected_missing = models.FloatField(blank=True, null=True)
affected_wrong = models.FloatField(blank=True, null=True)
entry_id = models.PositiveIntegerField() # entry id from deep
project_id = models.PositiveIntegerField() # project id from deep
generated_at = models.DateTimeField()
Expand All @@ -351,12 +378,39 @@ class ProjectWiseMatchRatios(models.Model):
sectors_completely_matched_mean = models.FloatField(blank=True, null=True)
sectors_missing_mean = models.FloatField(blank=True, null=True)
sectors_wrong_mean = models.FloatField(blank=True, null=True)
pillars_1d_completely_matched_mean = models.FloatField(blank=True, null=True)
pillars_1d_missing_mean = models.FloatField(blank=True, null=True)
pillars_1d_wrong_mean = models.FloatField(blank=True, null=True)
pillars_2d_completely_matched_mean = models.FloatField(blank=True, null=True)
pillars_2d_missing_mean = models.FloatField(blank=True, null=True)
pillars_2d_wrong_mean = models.FloatField(blank=True, null=True)
subpillars_1d_completely_matched_mean = models.FloatField(blank=True, null=True)
subpillars_1d_missing_mean = models.FloatField(blank=True, null=True)
subpillars_1d_wrong_mean = models.FloatField(blank=True, null=True)
subpillars_2d_completely_matched_mean = models.FloatField(blank=True, null=True)
subpillars_2d_missing_mean = models.FloatField(blank=True, null=True)
subpillars_2d_wrong_mean = models.FloatField(blank=True, null=True)
age_completely_matched_mean = models.FloatField(blank=True, null=True)
age_missing_mean = models.FloatField(blank=True, null=True)
age_wrong_mean = models.FloatField(blank=True, null=True)
displaced_completely_matched_mean = models.FloatField(blank=True, null=True)
displaced_missing_mean = models.FloatField(blank=True, null=True)
displaced_wrong_mean = models.FloatField(blank=True, null=True)
gender_completely_matched_mean = models.FloatField(blank=True, null=True)
gender_missing_mean = models.FloatField(blank=True, null=True)
gender_wrong_mean = models.FloatField(blank=True, null=True)
non_displaced_completely_matched_mean = models.FloatField(blank=True, null=True)
non_displaced_missing_mean = models.FloatField(blank=True, null=True)
non_displaced_wrong_mean = models.FloatField(blank=True, null=True)
severity_completely_matched_mean = models.FloatField(blank=True, null=True)
severity_missing_mean = models.FloatField(blank=True, null=True)
severity_wrong_mean = models.FloatField(blank=True, null=True)
specific_needs_groups_completely_matched_mean = models.FloatField(blank=True, null=True)
specific_needs_groups_missing_mean = models.FloatField(blank=True, null=True)
specific_needs_groups_wrong_mean = models.FloatField(blank=True, null=True)
affected_completely_matched_mean = models.FloatField(blank=True, null=True)
affected_missing_mean = models.FloatField(blank=True, null=True)
affected_wrong_mean = models.FloatField(blank=True, null=True)
generated_at = models.DateTimeField()

def __str__(self):
Expand Down
Loading