From 5656fde0d5a39af2db537c6428d6140a8c4c7637 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Wed, 26 May 2021 09:35:59 +0200 Subject: [PATCH] Refactoring: vaccination --- src/flask_covid19/blueprints/data_rki/rki_model.py | 1 + .../blueprints/data_rki/rki_service_update.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/flask_covid19/blueprints/data_rki/rki_model.py b/src/flask_covid19/blueprints/data_rki/rki_model.py index cde40c2e..b4a0f1e2 100644 --- a/src/flask_covid19/blueprints/data_rki/rki_model.py +++ b/src/flask_covid19/blueprints/data_rki/rki_model.py @@ -74,6 +74,7 @@ class RkiLandkreis(BlueprintLocation): cascade='save-update', order_by='RkiBundesland.location_group') id_landkreis = db.Column(db.String(255), nullable=False) + location_type = db.Column(db.String(255), nullable=False) @classmethod def get_bochum(cls): diff --git a/src/flask_covid19/blueprints/data_rki/rki_service_update.py b/src/flask_covid19/blueprints/data_rki/rki_service_update.py index 701802f0..6fd52ff1 100644 --- a/src/flask_covid19/blueprints/data_rki/rki_service_update.py +++ b/src/flask_covid19/blueprints/data_rki/rki_service_update.py @@ -77,9 +77,14 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): for landkreis_from_import in RkiImport.get_landkreis_for_bundesland(bundesland=bundesland.location_group): i += 1 # app.logger.info("landkreis_from_import: "+str(landkreis_from_import)) + my_location_tmp = landkreis_from_import[0].split(" "), + my_id_landkreis = landkreis_from_import[1], + my_location = my_location_tmp[0] + my_location_type = my_location_tmp[1] o = RkiLandkreis( - location=landkreis_from_import[0], - id_landkreis=landkreis_from_import[1], + location=my_location, + id_landkreis=my_id_landkreis, + location_type=my_location_type, location_group=bundesland, processed_update=False, processed_full_update=True, -- GitLab