Skip to content
Snippets Groups Projects
Commit 76235ba0 authored by thomaswoehlke's avatar thomaswoehlke
Browse files

work

parent 973e3b8c
No related branches found
No related tags found
No related merge requests found
...@@ -33,15 +33,6 @@ my_logging_config = { ...@@ -33,15 +33,6 @@ my_logging_config = {
run_run_with_debug = app.config['APP_DEBUGGER_ACTIVE'] run_run_with_debug = app.config['APP_DEBUGGER_ACTIVE']
def transform_datum_europe(my_date):
my_date_reported = my_date.split('/')
my_year = int(my_date_reported[2])
my_month = int(my_date_reported[1])
my_day = int(my_date_reported[0])
my_datum = date(year=my_year, month=my_month, day=my_day)
return my_datum
def transform_datum(my_date_reported): def transform_datum(my_date_reported):
my_date_reported = my_date_reported.split("-") my_date_reported = my_date_reported.split("-")
my_year = int(my_date_reported[0]) my_year = int(my_date_reported[0])
......
import os import os
from database import db, app, transform_datum_europe from datetime import date
from database import db, app
from org.woehlke.covid19.europe.europe_model import EuropeDataImportTable, \ from org.woehlke.covid19.europe.europe_model import EuropeDataImportTable, \
EuropeDateReported, EuropeContinent, EuropeCountry, EuropeData EuropeDateReported, EuropeContinent, EuropeCountry, EuropeData
...@@ -18,18 +19,28 @@ class EuropeServiceUpdate: ...@@ -18,18 +19,28 @@ class EuropeServiceUpdate:
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
app.logger.info(" Europe Service Update [ready] ") app.logger.info(" Europe Service Update [ready] ")
def __transform_datum(my_date):
my_date_reported = my_date.split('/')
my_year = int(my_date_reported[2])
my_month = int(my_date_reported[1])
my_day = int(my_date_reported[0])
my_datum = date(year=my_year, month=my_month, day=my_day)
return my_datum
def __update_date_reported(self): def __update_date_reported(self):
app.logger.info(" __update_date_reported [begin]") app.logger.info(" __update_date_reported [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
result_date_rep = EuropeDataImportTable.get_date_rep() result_date_rep = EuropeDataImportTable.get_date_rep()
k = 0
for result_item in result_date_rep: for result_item in result_date_rep:
k += 1
my_date_rep = result_item['date_rep'] my_date_rep = result_item['date_rep']
my_year_week = result_item['year_week'] my_year_week = result_item['year_week']
app.logger.info("| " + my_date_rep + " | " + my_year_week + " |") app.logger.info("| " + my_date_rep + " | " + my_year_week + " | (" + k + ")")
o = EuropeDateReported( o = EuropeDateReported(
date_rep=my_date_rep, date_rep=my_date_rep,
year_week=my_year_week, year_week=my_year_week,
datum=transform_datum_europe(my_date_rep) datum=self.__transform_datum(my_date_rep)
) )
db.session.add(o) db.session.add(o)
db.session.commit() db.session.commit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment