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

Refactoring: vaccination

parent 49d3eb76
No related branches found
No related tags found
1 merge request!162Refactoring 2021 05 20 start
...@@ -51,6 +51,17 @@ class BlueprintDateReportedFactory: ...@@ -51,6 +51,17 @@ class BlueprintDateReportedFactory:
datum_parts = (my_year, my_month, my_day) datum_parts = (my_year, my_month, my_day)
return datum_parts return datum_parts
@classmethod
def __get_datetime_german_parts(cls, my_datetime: str):
my_datetime_parts = my_datetime.split(",")
my_date_rep = my_datetime_parts[0]
my_date_parts = my_date_rep.split('.')
my_day = int(my_date_parts[0])
my_month = int(my_date_parts[1])
my_year = int(my_date_parts[2])
datum_parts = (my_year, my_month, my_day)
return datum_parts
@classmethod @classmethod
def __get_datum_parts(cls, my_date_rep: str): def __get_datum_parts(cls, my_date_rep: str):
my_date_parts = my_date_rep.split("-") my_date_parts = my_date_rep.split("-")
...@@ -264,7 +275,7 @@ class BlueprintDateReportedFactory: ...@@ -264,7 +275,7 @@ class BlueprintDateReportedFactory:
@classmethod @classmethod
def create_new_object_for_rki_date_datenstand(cls, my_date_rep: str): def create_new_object_for_rki_date_datenstand(cls, my_date_rep: str):
(my_year, my_month, my_day) = cls.__get_datetime_parts(my_date_rep) (my_year, my_month, my_day) = cls.__get_datetime_german_parts(my_datetime=my_date_rep)
my_datum = date(my_year, my_month, my_day) my_datum = date(my_year, my_month, my_day)
o = cls.__create_new_object_factory(date_reported_import_str=my_date_rep, my_datum=my_datum) o = cls.__create_new_object_factory(date_reported_import_str=my_date_rep, my_datum=my_datum)
return cls.__get_rki_date_datenstand(o) return cls.__get_rki_date_datenstand(o)
......
...@@ -172,6 +172,9 @@ class RkiAltersgruppe(BlueprintEntity): ...@@ -172,6 +172,9 @@ class RkiAltersgruppe(BlueprintEntity):
__tablename__ = 'rki_altersgruppe' __tablename__ = 'rki_altersgruppe'
__mapper_args__ = {'concrete': True} __mapper_args__ = {'concrete': True}
def __str__(self):
return " " + self.altersgruppe + " "
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
processed_update = db.Column(db.Boolean, nullable=False) processed_update = db.Column(db.Boolean, nullable=False)
processed_full_update = db.Column(db.Boolean, nullable=False) processed_full_update = db.Column(db.Boolean, nullable=False)
......
...@@ -82,7 +82,7 @@ class RkiServiceUpdateFull(RkiServiceUpdateBase): ...@@ -82,7 +82,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("------------------------------------------------------------")
RkiBundesland.remove_all() RkiAltersgruppe.remove_all()
app.logger.info("") app.logger.info("")
i = 0 i = 0
output_lines = [] output_lines = []
......
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