From 403ceac83c53638ff7f86de6577f0e9b1d14a499 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Mon, 8 Feb 2021 10:07:09 +0100 Subject: [PATCH] work --- BACKLOG.md | 2 +- src/covid19/blueprints/rki/rki_model.py | 4 ++-- src/covid19/blueprints/rki/rki_service_update.py | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/BACKLOG.md b/BACKLOG.md index 664c0fdb..10896021 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -161,7 +161,7 @@ * Issue #121 implement EuropeServiceUpdate.update_star_schema_incremental * Issue #122 implement EuropeServiceUpdate.update_star_schema_initial * Issue #123 split RkiService into two Services, one for bundeslaender and one for landkreise -* Issue #124 rename RkiGermanyData to RkiBundeslaender +* Issue #124 rename RkiBundeslaender to RkiBundeslaender * Issue #125 implement RkiLandkreise * Issue #126 implement RkiBundeslaenderImport * Issue #127 implement RkiBundeslaenderImport.get_dates_reported diff --git a/src/covid19/blueprints/rki/rki_model.py b/src/covid19/blueprints/rki/rki_model.py index 1cc7645a..1e99b6cc 100644 --- a/src/covid19/blueprints/rki/rki_model.py +++ b/src/covid19/blueprints/rki/rki_model.py @@ -101,8 +101,8 @@ class RkiCountry(db.Model): # TODO: #123 split RkiService into two Services, one for bundeslaender and one for landkreise -# TODO: #124 rename RkiGermanyData to RkiBundeslaender -class RkiGermanyData(db.Model): +# TODO: #124 rename RkiBundeslaender to RkiBundeslaender +class RkiBundeslaender(db.Model): __tablename__ = 'rki_bundeslsaender' id = db.Column(db.Integer, primary_key=True) diff --git a/src/covid19/blueprints/rki/rki_service_update.py b/src/covid19/blueprints/rki/rki_service_update.py index f29794ba..dad79879 100644 --- a/src/covid19/blueprints/rki/rki_service_update.py +++ b/src/covid19/blueprints/rki/rki_service_update.py @@ -1,6 +1,6 @@ from database import db, app -from covid19.blueprints.rki.rki_model import RkiRegion, RkiDateReported, RkiCountry, RkiGermanyData +from covid19.blueprints.rki.rki_model import RkiRegion, RkiDateReported, RkiCountry, RkiBundeslaender from covid19.blueprints.rki.rki_model_import import RkiBundeslaenderImport, RkiLandkreiseImport from covid19.blueprints.rki.rki_model_import import RkiGermanyDataImportTable @@ -115,11 +115,11 @@ class RkiServiceUpdate: for result_item in result: my_country = countries[result_item.country_code] my_date_reported = dates_reported[result_item.date_reported] - result_who_global_data = RkiGermanyData.find_one_or_none_by_date_and_country( + result_who_global_data = RkiBundeslaender.find_one_or_none_by_date_and_country( my_date_reported, my_country) if result_who_global_data is None: - o = RkiGermanyData( + o = RkiBundeslaender( cases_new=int(result_item.new_cases), cases_cumulative=int(result_item.cumulative_cases), deaths_new=int(result_item.new_deaths), @@ -148,7 +148,7 @@ class RkiServiceUpdate: my_date = RkiDateReported.find_by_date_reported(my_date_reported) for result_item in RkiGermanyDataImportTable.get_for_one_day(my_date_reported): my_country = RkiCountry.find_by_country_code(result_item.country_code) - o = RkiGermanyData( + o = RkiBundeslaender( cases_new=int(result_item.new_cases), cases_cumulative=int(result_item.cumulative_cases), deaths_new=int(result_item.new_deaths), @@ -173,14 +173,14 @@ class RkiServiceUpdate: def __update_who_global_data_initial(self): app.logger.info(" update RKI initial [begin]") app.logger.info("------------------------------------------------------------") - RkiGermanyData.remove_all() + RkiBundeslaender.remove_all() new_dates_reported_from_import = RkiGermanyDataImportTable.get_new_dates_as_array() i = 0 for my_date_reported in new_dates_reported_from_import: my_date = RkiDateReported.find_by_date_reported(my_date_reported) for result_item in RkiGermanyDataImportTable.get_for_one_day(my_date_reported): my_country = RkiCountry.find_by_country_code(result_item.country_code) - o = RkiGermanyData( + o = RkiBundeslaender( cases_new=int(result_item.new_cases), cases_cumulative=int(result_item.cumulative_cases), deaths_new=int(result_item.new_deaths), -- GitLab