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

### 0.0.17 Release

* Fixed #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise
* Fixed #128 add fields from csv to RkiLandkreiseImport
* Fixed #139 refactor RkiBundeslaenderServiceDownload to new method scheme introduced 07.02.2021
* Fixed #140 move WhoImport to RKI in: rk_service_import.py
* Fixed #125 implement RkiLandkreise
* Fixed #126 implement RkiBundeslaenderImport

### 0.0.18 Release
* Fixed #39 SQLalchemy instead of SQL: AllModelClasses.remove_all()
* Fixed #40 SQLalchemy instead of SQL: EcdcImport.get_date_rep()
* Fixed #41 SQLalchemy instead of SQL: EcdcImport.get_countries_of_continent()
* Fixed #107 SQLalchemy instead of SQL in: EcdcImport.get_countries_of_continent
* Fixed #109 SQLalchemy instead of SQL in: EcdcImport.get_date_rep
* Fixed #110 SQLalchemy instead of SQL in: EcdcImport.get_continent
parent 11f14044
No related branches found
No related tags found
No related merge requests found
...@@ -186,7 +186,13 @@ ...@@ -186,7 +186,13 @@
### 0.0.17 Release ### 0.0.17 Release
* ------------------------------------- * -------------------------------------
* Issue #82 change to ORM ClassHierarchy * Issue #82 change to ORM ClassHierarchy
* Issue #108 change to ORM ClassHierarchy in: EcdcImport.get_countries_of_continent * Fixed #108 change to ORM ClassHierarchy in: EcdcImport.get_countries_of_continent
* Fixed #39 SQLalchemy instead of SQL: AllModelClasses.remove_all()
* Fixed #40 SQLalchemy instead of SQL: EcdcImport.get_date_rep()
* Fixed #41 SQLalchemy instead of SQL: EcdcImport.get_countries_of_continent()
* Fixed #107 SQLalchemy instead of SQL in: EcdcImport.get_countries_of_continent
* Fixed #109 SQLalchemy instead of SQL in: EcdcImport.get_date_rep
* Fixed #110 SQLalchemy instead of SQL in: EcdcImport.get_continent
* ------------------------------------- * -------------------------------------
* Fixed #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise * Fixed #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise
* Fixed #128 add fields from csv to RkiLandkreiseImport * Fixed #128 add fields from csv to RkiLandkreiseImport
...@@ -221,12 +227,6 @@ ...@@ -221,12 +227,6 @@
* Issue #155 refactor RkiBundeslaenderServiceUpdate.update_db_initial * Issue #155 refactor RkiBundeslaenderServiceUpdate.update_db_initial
### 0.0.18 Release ### 0.0.18 Release
* Fixed #39 SQLalchemy instead of SQL: AllModelClasses.remove_all()
* Fixed #40 SQLalchemy instead of SQL: EcdcImport.get_date_rep()
* Fixed #41 SQLalchemy instead of SQL: EcdcImport.get_countries_of_continent()
* Fixed #107 SQLalchemy instead of SQL in: EcdcImport.get_countries_of_continent
* Fixed #109 SQLalchemy instead of SQL in: EcdcImport.get_date_rep
* Fixed #110 SQLalchemy instead of SQL in: EcdcImport.get_continent
* Issue #42 SQLalchemy instead of SQL: WhoImport.get_new_dates_as_array() * Issue #42 SQLalchemy instead of SQL: WhoImport.get_new_dates_as_array()
* Issue #83 SQLalchemy instead of SQL in WhoImport.get_new_dates_as_array * Issue #83 SQLalchemy instead of SQL in WhoImport.get_new_dates_as_array
......
...@@ -6,7 +6,9 @@ class EcdcImport(db.Model): ...@@ -6,7 +6,9 @@ class EcdcImport(db.Model):
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
date_rep = db.Column(db.String(255), nullable=False) date_rep = db.Column(db.String(255), nullable=False)
year_week = db.Column(db.String(255), nullable=False) day = db.Column(db.String(255), nullable=False)
month = db.Column(db.String(255), nullable=False)
year = db.Column(db.String(255), nullable=False)
cases_weekly = db.Column(db.String(255), nullable=False) cases_weekly = db.Column(db.String(255), nullable=False)
deaths_weekly = db.Column(db.String(255), nullable=False) deaths_weekly = db.Column(db.String(255), nullable=False)
pop_data_2019 = db.Column(db.String(255), nullable=False) pop_data_2019 = db.Column(db.String(255), nullable=False)
...@@ -26,14 +28,14 @@ class EcdcImport(db.Model): ...@@ -26,14 +28,14 @@ class EcdcImport(db.Model):
@classmethod @classmethod
def get_all_as_page(cls, page: int): def get_all_as_page(cls, page: int):
return db.session.query(cls).order_by( return db.session.query(cls).order_by(
cls.year_week, #cls.year_week,
cls.countries_and_territories cls.countries_and_territories
).paginate(page, per_page=ITEMS_PER_PAGE) ).paginate(page, per_page=ITEMS_PER_PAGE)
@classmethod @classmethod
def get_all(cls): def get_all(cls):
return db.session.query(cls).order_by( return db.session.query(cls).order_by(
cls.year_week, #cls.year_week,
cls.countries_and_territories cls.countries_and_territories
).all() ).all()
...@@ -43,7 +45,6 @@ class EcdcImport(db.Model): ...@@ -43,7 +45,6 @@ class EcdcImport(db.Model):
@classmethod @classmethod
def get_date_rep(cls): def get_date_rep(cls):
# TODO: #109 SQLalchemy instead of SQL in: EcdcImport.get_date_rep
# sql = "select distinct date_rep, year_week from edcd_import order by year_week desc" # sql = "select distinct date_rep, year_week from edcd_import order by year_week desc"
#return db.session.execute(sql).fetchall() #return db.session.execute(sql).fetchall()
return db.session.query(cls.date_rep) \ return db.session.query(cls.date_rep) \
...@@ -54,7 +55,6 @@ class EcdcImport(db.Model): ...@@ -54,7 +55,6 @@ class EcdcImport(db.Model):
@classmethod @classmethod
def get_continent(cls): def get_continent(cls):
# TODO: #110 SQLalchemy instead of SQL in: EcdcImport.get_continent
# sql = "select distinct continent_exp from edcd_import order by continent_exp asc" # sql = "select distinct continent_exp from edcd_import order by continent_exp asc"
#return db.session.execute(sql).fetchall() #return db.session.execute(sql).fetchall()
return db.session.query(cls.continent_exp) \ return db.session.query(cls.continent_exp) \
...@@ -68,8 +68,6 @@ class EcdcImport(db.Model): ...@@ -68,8 +68,6 @@ class EcdcImport(db.Model):
my_continent_exp = my_continent.region my_continent_exp = my_continent.region
my_params = {} my_params = {}
my_params['my_continent_param'] = my_continent_exp my_params['my_continent_param'] = my_continent_exp
#TODO: #107 SQLalchemy instead of SQL in: EcdcImport.get_countries_of_continent
#TODO: #108 BUG: change to ORM ClassHierarchy in: EcdcImport.get_countries_of_continent
return db.session.query( return db.session.query(
cls.countries_and_territories, cls.countries_and_territories,
cls.pop_data_2019, cls.pop_data_2019,
......
...@@ -31,7 +31,9 @@ class EcdcServiceImport: ...@@ -31,7 +31,9 @@ class EcdcServiceImport:
for row in file_reader: for row in file_reader:
o = EcdcImport( o = EcdcImport(
date_rep=row['dateRep'], date_rep=row['dateRep'],
year_week=row['year_week'], day=row['day'],
month=row['month'],
year=row['year'],
cases_weekly=row['cases_weekly'], cases_weekly=row['cases_weekly'],
deaths_weekly=row['deaths_weekly'], deaths_weekly=row['deaths_weekly'],
countries_and_territories=row['countriesAndTerritories'], countries_and_territories=row['countriesAndTerritories'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment