diff --git a/src/flask_covid19/blueprints/data_rki/rki_model.py b/src/flask_covid19/blueprints/data_rki/rki_model.py index 4b5c7a51b9372ef2a35ea0f3d92e10c0d6fee289..95a7666a16bf65d436b1c97a0bd20360a0fcb6f9 100644 --- a/src/flask_covid19/blueprints/data_rki/rki_model.py +++ b/src/flask_covid19/blueprints/data_rki/rki_model.py @@ -159,7 +159,7 @@ class RkiLandkreis(BlueprintLocation): return db.session.query(cls).order_by(cls.location).all() @classmethod - def find_by_location_group(cls, location_group: RkiBundesland, page: int): + def find_by_location_group(cls, location_group: RkiBundesland): return db.session.query(cls).filter( cls.location_group == location_group ).order_by(cls.location).all() @@ -174,16 +174,11 @@ class RkiLandkreis(BlueprintLocation): def find_all_as_dict(cls): rki_landkreis_dict = {} for my_rki_landkreis in cls.find_all(): - rki_landkreis_dict[my_rki_landkreis.location] = my_rki_landkreis + my_key = my_rki_landkreis.location_type + " " + my_rki_landkreis.location + rki_landkreis_dict[my_key] = my_rki_landkreis return rki_landkreis_dict -association_table_rki_to_altersgruppe = db.Table('rki_to_altersgruppe', db.Model.metadata, - db.Column('rki_id', db.Integer, db.ForeignKey('rki.id')), - db.Column('rki_altersgruppe_id', db.Integer, db.ForeignKey('rki_altersgruppe.id')) -) - - class RkiAltersgruppe(BlueprintEntity): __tablename__ = 'rki_altersgruppe' __mapper_args__ = {'concrete': True} 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 99c9911afa14030106a056b141ed71ce26af410c..3fcdbffd26263baaf79a44aea0fa9fa8f43edeac 100644 --- a/src/flask_covid19/blueprints/data_rki/rki_service_update.py +++ b/src/flask_covid19/blueprints/data_rki/rki_service_update.py @@ -209,12 +209,12 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): # app.logger.info("------------------------------------------------------------") for o_import in list_imports: # app.logger.info("o_import.landkreis " + o_import.landkreis) - key_location = o_import.landkreis.split(" ")[1] + key_location = o_import.landkreis key_altersgruppen = o_import.altersgruppe - my_altersgruppe = dict_altersgruppen[key_altersgruppen] - my_landkreis = dict_locations[key_location] key_datenstand = o_import.datenstand key_ref_datum = o_import.ref_datum + my_altersgruppe = dict_altersgruppen[key_altersgruppen] + my_landkreis = dict_locations[key_location] my_datenstand = dict_datenstand[key_datenstand] my_ref_datum = dict_ref_datum[key_ref_datum] # app.logger.info(str(my_landkreis))