forked from mysociety/local-intelligence-hub
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP import data from datasources for use in mapping
- Loading branch information
1 parent
332380c
commit 543cb7d
Showing
23 changed files
with
502 additions
and
128 deletions.
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
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,6 @@ | ||
import strawberry | ||
|
||
def key_resolver(key: str): | ||
def resolver(self): | ||
return self.get(key, None) | ||
return strawberry.field(resolver=resolver) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 4.2.10 on 2024-03-11 03:13 | ||
|
||
from django.db import migrations | ||
import django_jsonform.models.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("hub", "0076_externaldatasource_autoimport_enabled_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="externaldatasource", | ||
name="fields", | ||
field=django_jsonform.models.fields.JSONField( | ||
blank=True, default=[], null=True | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="externaldatasource", | ||
name="auto_update_mapping", | ||
field=django_jsonform.models.fields.JSONField( | ||
blank=True, default=[], null=True | ||
), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
hub/migrations/0078_rename_auto_update_mapping_externaldatasource_update_mapping.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,18 @@ | ||
# Generated by Django 4.2.10 on 2024-03-11 03:15 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("hub", "0077_externaldatasource_fields_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="externaldatasource", | ||
old_name="auto_update_mapping", | ||
new_name="update_mapping", | ||
), | ||
] |
31 changes: 31 additions & 0 deletions
31
hub/migrations/0079_alter_externaldatasource_geography_column_type.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,31 @@ | ||
# Generated by Django 4.2.10 on 2024-03-11 03:45 | ||
|
||
from django.db import migrations | ||
import django_choices_field.fields | ||
import hub.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("hub", "0078_rename_auto_update_mapping_externaldatasource_update_mapping"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="externaldatasource", | ||
name="geography_column_type", | ||
field=django_choices_field.fields.TextChoicesField( | ||
choices=[ | ||
("postcode", "Postcode"), | ||
("ward", "Ward"), | ||
("council", "Council"), | ||
("constituency", "Constituency"), | ||
("constituency_2025", "Constituency (2024)"), | ||
], | ||
choices_enum=hub.models.ExternalDataSource.PostcodesIOGeographyTypes, | ||
default="postcode", | ||
max_length=17, | ||
), | ||
), | ||
] |
39 changes: 39 additions & 0 deletions
39
hub/migrations/0080_dataset_external_data_source_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,39 @@ | ||
# Generated by Django 4.2.10 on 2024-03-11 09:56 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django_jsonform.models.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("hub", "0079_alter_externaldatasource_geography_column_type"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="dataset", | ||
name="external_data_source", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="hub.externaldatasource", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="externaldatasource", | ||
name="fields", | ||
field=django_jsonform.models.fields.JSONField( | ||
blank=True, default=list, null=True | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="externaldatasource", | ||
name="update_mapping", | ||
field=django_jsonform.models.fields.JSONField( | ||
blank=True, default=list, null=True | ||
), | ||
), | ||
] |
Oops, something went wrong.