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

* Fixed #123 split RkiBundeslaenderService into two Services, one for...

* Fixed #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise
parent 91e0e0b2
No related branches found
No related tags found
No related merge requests found
......@@ -193,7 +193,7 @@
* Issue #146 add Tasks and URLs for starting Tasks to rki_views
* Issue #140 move WhoImport to RKI in: rk_service_import.py
* Issue #139 refactor RkiBundeslaenderServiceDownload to new method scheme introduced 07.02.2021
* Issue #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
* Issue #125 implement RkiLandkreise
* Issue #126 implement RkiBundeslaenderImport
* Issue #127 implement RkiBundeslaenderImport.get_dates_reported
......
......@@ -3,8 +3,6 @@ from datetime import date
from sqlalchemy.orm import joinedload
from database import db, ITEMS_PER_PAGE
from covid19.blueprints.common.common_model import CommonDateReported, CommonRegion
from covid19.blueprints.rki.rki_model import RkiDateReported, RkiRegion, RkiCountry
# TODO: #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise
......
......@@ -3,20 +3,31 @@ from database import db, ITEMS_PER_PAGE
# OBJECTID_1,LAN_ew_AGS,LAN_ew_GEN,LAN_ew_BEZ,LAN_ew_EWZ,OBJECTID,Fallzahl,Aktualisierung,AGS_TXT,GlobalID,faelle_100000_EW,Death,cases7_bl_per_100k,cases7_bl,death7_bl,cases7_bl_per_100k_txt,AdmUnitId,SHAPE_Length,SHAPE_Area
# TODO: #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise
# TODO: #128 add fields from csv to RkiLandkreiseImport
class RkiLandkreiseImport(db.Model):
__tablename__ = 'rki_landkreise_import'
id = db.Column(db.Integer, primary_key=True)
date_reported = db.Column(db.String(255), nullable=False)
country_code = db.Column(db.String(255), nullable=False)
country = db.Column(db.String(255), nullable=False)
who_region = db.Column(db.String(255), nullable=False)
new_cases = db.Column(db.String(255), nullable=False)
cumulative_cases = db.Column(db.String(255), nullable=False)
new_deaths = db.Column(db.String(255), nullable=False)
cumulative_deaths = db.Column(db.String(255), nullable=False)
OBJECTID_1 = db.Column(db.String(255), nullable=False)
LAN_ew_AGS = db.Column(db.String(255), nullable=False)
LAN_ew_GEN = db.Column(db.String(255), nullable=False)
LAN_ew_BEZ = db.Column(db.String(255), nullable=False)
LAN_ew_EWZ = db.Column(db.String(255), nullable=False)
OBJECTID = db.Column(db.String(255), nullable=False)
Fallzahl = db.Column(db.String(255), nullable=False)
Aktualisierung = db.Column(db.String(255), nullable=False)
AGS_TXT = db.Column(db.String(255), nullable=False)
GlobalID = db.Column(db.String(255), nullable=False)
faelle_100000_EW = db.Column(db.String(255), nullable=False)
Death = db.Column(db.String(255), nullable=False)
cases7_bl_per_100k = db.Column(db.String(255), nullable=False)
cases7_bl = db.Column(db.String(255), nullable=False)
death7_bl = db.Column(db.String(255), nullable=False)
cases7_bl_per_100k_txt = db.Column(db.String(255), nullable=False)
AdmUnitId = db.Column(db.String(255), nullable=False)
SHAPE_Length = db.Column(db.String(255), nullable=False)
SHAPE_Area = db.Column(db.String(255), nullable=False)
@classmethod
def remove_all(cls):
......@@ -37,17 +48,6 @@ class RkiLandkreiseImport(db.Model):
def get_by_id(cls, other_id):
return db.session.query(cls).filter(cls.id == other_id).one()
@classmethod
def get_regions(cls):
return db.session.query(cls.who_region).distinct()
@classmethod
def get_dates_reported(cls):
return db.session.query(cls.date_reported).distinct()
@classmethod
def get_for_one_day(cls, day):
return db.session.query(cls).filter(cls.date_reported == day).all()
@classmethod
def get_new_dates_as_array(cls):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment