From cd5d969a57def3b116e38bd811713e824dd01198 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Sun, 4 Apr 2021 00:19:31 +0200 Subject: [PATCH] update data --- src/covid19/blueprints/owid/owid_service_update.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/covid19/blueprints/owid/owid_service_update.py b/src/covid19/blueprints/owid/owid_service_update.py index 96779059..025ab78d 100644 --- a/src/covid19/blueprints/owid/owid_service_update.py +++ b/src/covid19/blueprints/owid/owid_service_update.py @@ -154,10 +154,15 @@ class OwidServiceUpdate: db.session.add(my_OwidContinent) db.session.commit() my_OwidContinent = OwidContinent.find_by_region(i_region=oi.continent) - my_OwidCountry = OwidCountry.find_by_iso_code_and_location(iso_code=oi.iso_code, location=oi.location) + my_OwidCountry = OwidCountry.find_by_iso_code_and_location( + iso_code=oi.iso_code, + location=oi.location + ) if my_OwidCountry is None: my_OwidCountry = OwidCountry( continent=my_OwidContinent, + iso_code=oi.iso_code, + location=oi.location, population=oi.population, population_density=oi.population_density, median_age=oi.median_age, @@ -176,7 +181,10 @@ class OwidServiceUpdate: ) db.session.add(my_OwidCountry) db.session.commit() - my_OwidCountry = OwidCountry.find_by_iso_code(iso_code=oi.iso_code, location=oi.location) + my_OwidCountry = OwidCountry.find_by_iso_code( + iso_code=oi.iso_code, + location=oi.location + ) o = OwidData( date_reported=my_OwidDateReported, country=my_OwidCountry, -- GitLab