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

update data

parent 201e1551
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment