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

Refactoring: vaccination

parent 2d5804a0
No related branches found
No related tags found
1 merge request!162Refactoring 2021 05 20 start
...@@ -21,6 +21,13 @@ class BlueprintEntity(db.Model): ...@@ -21,6 +21,13 @@ class BlueprintEntity(db.Model):
db.session.rollback() db.session.rollback()
return num_rows_deleted return num_rows_deleted
@classmethod
def delete_all(cls):
for o in cls.find_all():
o.remove()
db.session.commit()
return None
@classmethod @classmethod
def get_all_as_page(cls, page: int): def get_all_as_page(cls, page: int):
return db.session.query(cls)\ return db.session.query(cls)\
......
...@@ -22,7 +22,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -22,7 +22,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
def __full_update_date_datenstand(self): def __full_update_date_datenstand(self):
app.logger.info(" RkiServiceUpdateFull.__full_update_date_datenstand [begin]") app.logger.info(" RkiServiceUpdateFull.__full_update_date_datenstand [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
RkiDatenstand.remove_all() RkiDatenstand.delete_all()
i = 0 i = 0
output_lines = [] output_lines = []
for datum_of_import in RkiImport.get_date_datenstand_of_all_import(): for datum_of_import in RkiImport.get_date_datenstand_of_all_import():
...@@ -42,7 +42,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -42,7 +42,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
def __full_update_date_ref_datum(self): def __full_update_date_ref_datum(self):
app.logger.info(" RkiServiceUpdateFull.__full_update_date_ref_datum [begin]") app.logger.info(" RkiServiceUpdateFull.__full_update_date_ref_datum [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
RkiRefDatum.remove_all() RkiRefDatum.delete_all()
i = 0 i = 0
output_lines = [] output_lines = []
for datum_of_import in RkiImport.get_date_ref_datum_of_all_import(): for datum_of_import in RkiImport.get_date_ref_datum_of_all_import():
...@@ -62,7 +62,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -62,7 +62,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
def __full_update_date_reported(self): def __full_update_date_reported(self):
app.logger.info(" RkiServiceUpdateFull.__full_update_date_reported [begin]") app.logger.info(" RkiServiceUpdateFull.__full_update_date_reported [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
RkiMeldedatum.remove_all() RkiMeldedatum.delete_all()
i = 0 i = 0
output_lines = [] output_lines = []
for datum_of_import in RkiImport.get_meldedatum_list(): for datum_of_import in RkiImport.get_meldedatum_list():
...@@ -85,7 +85,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -85,7 +85,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
def __full_update_altersgruppe(self): def __full_update_altersgruppe(self):
app.logger.info(" RkiServiceUpdateFull.__full_update_altersgruppe [begin]") app.logger.info(" RkiServiceUpdateFull.__full_update_altersgruppe [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
RkiAltersgruppe.remove_all() RkiAltersgruppe.delete_all()
app.logger.info("") app.logger.info("")
i = 0 i = 0
output_lines = [] output_lines = []
...@@ -108,13 +108,13 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -108,13 +108,13 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
return self return self
def __clean_bundesland(self): def __clean_bundesland(self):
RkiBundesland.remove_all() RkiBundesland.delete_all()
return self return self
def __full_update_bundesland(self): def __full_update_bundesland(self):
app.logger.info(" RkiServiceUpdateFull.__full_update_bundesland [begin]") app.logger.info(" RkiServiceUpdateFull.__full_update_bundesland [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
RkiBundesland.remove_all() RkiBundesland.delete_all()
app.logger.info("") app.logger.info("")
i = 0 i = 0
output_lines = [] output_lines = []
...@@ -139,12 +139,12 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -139,12 +139,12 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
return self return self
def __clean_landkreis(self): def __clean_landkreis(self):
RkiLandkreis.remove_all() RkiLandkreis.delete_all()
self.__clean_bundesland() self.__clean_bundesland()
return self return self
def __full_update_landkreis(self): def __full_update_landkreis(self):
RkiLandkreis.remove_all() RkiLandkreis.delete_all()
self.__full_update_bundesland() self.__full_update_bundesland()
app.logger.info(" RkiServiceUpdateFull.__full_update_landkreis [begin]") app.logger.info(" RkiServiceUpdateFull.__full_update_landkreis [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
...@@ -179,13 +179,13 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -179,13 +179,13 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
return self return self
def __clean_data(self): def __clean_data(self):
RkiData.remove_all() RkiData.delete_all()
return self return self
def __full_update_data(self): def __full_update_data(self):
app.logger.info(" RkiServiceUpdateFull.__full_update_data [begin]") app.logger.info(" RkiServiceUpdateFull.__full_update_data [begin]")
app.logger.info("------------------------------------------------------------") app.logger.info("------------------------------------------------------------")
RkiData.remove_all() RkiData.delete_all()
i = 0 i = 0
d = 0 d = 0
k = 0 k = 0
...@@ -267,12 +267,12 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -267,12 +267,12 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
return self return self
def __clean_dimension_tables(self): def __clean_dimension_tables(self):
RkiMeldedatum.remove_all() RkiMeldedatum.delete_all()
RkiDatenstand.remove_all() RkiDatenstand.delete_all()
RkiRefDatum.remove_all() RkiRefDatum.delete_all()
RkiAltersgruppe.remove_all() RkiAltersgruppe.delete_all()
RkiLandkreis.remove_all() RkiLandkreis.delete_all()
RkiBundesland.remove_all() RkiBundesland.delete_all()
return self return self
def full_update_dimension_tables(self): def full_update_dimension_tables(self):
...@@ -286,7 +286,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -286,7 +286,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase):
return self return self
def __clean_fact_table(self): def __clean_fact_table(self):
RkiData.remove_all() RkiData.delete_all()
return self return self
def full_update_fact_table(self): def full_update_fact_table(self):
......
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