From 7ef9fd1c2ac83d5a82fd128c6add7c34fc00e064 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Tue, 19 Jan 2021 13:59:16 +0100 Subject: [PATCH] ### 0.0.8 Release * Fixed #13 /who/imported/ * Fixed #14 /europe/imported/ * Fixed #15 /who/update: Download * Fixed #16 /who/update: Import File to DB * Issue #17 /who/update: Update DB * Issue #3 ORM: 3NF for ecdc_europa_data_import * Issue #4 data update for 3NF ecdc_europa_data_import --- org/woehlke/covid19/europe/europe_model.py | 2 +- org/woehlke/covid19/europe/europe_service_update.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org/woehlke/covid19/europe/europe_model.py b/org/woehlke/covid19/europe/europe_model.py index ddd018ba..35e80f76 100644 --- a/org/woehlke/covid19/europe/europe_model.py +++ b/org/woehlke/covid19/europe/europe_model.py @@ -37,7 +37,7 @@ class EuropeDataImportTable(db.Model): @classmethod def get_date_rep(cls): sql = "select distinct date_rep, year_week from europe_data_import order by year_week desc" - return db.session.execute(sql).all() + return db.session.execute(sql) class EuropeDateReported(db.Model): diff --git a/org/woehlke/covid19/europe/europe_service_update.py b/org/woehlke/covid19/europe/europe_service_update.py index bda421df..fc305cac 100644 --- a/org/woehlke/covid19/europe/europe_service_update.py +++ b/org/woehlke/covid19/europe/europe_service_update.py @@ -19,12 +19,16 @@ class EuropeServiceUpdate: app.logger.info(" Europe Service Update [ready] ") def __update_date_reported(self): + app.logger.info(" __update_date_reported [begin]") + app.logger.info("------------------------------------------------------------") EuropeDataImportTable.remove_all() - result = EuropeDataImportTable.get_date_rep() - for result_item in result.items: + result_date_rep = EuropeDataImportTable.get_date_rep() + for result_item in result_date_rep: my_date_rep = result_item['date_rep'] year_week = result_item['year_week'] app.logger.info("| "+my_date_rep+" | "+year_week+" |") + app.logger.info(" __update_date_reported [done]") + app.logger.info("------------------------------------------------------------") return self def update_db(self): -- GitLab