diff --git a/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py b/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py index cfe1e18f1ae7f7c02b38d08be15a2fd027cae436..35a0f3939964a07d44d037135df226efb2799cdb 100644 --- a/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py +++ b/src/flask_covid19/blueprints/data_ecdc/ecdc_model.py @@ -1,5 +1,5 @@ from sqlalchemy import and_ -from sqlalchemy.orm import joinedload, subqueryload +from sqlalchemy.orm import joinedload from database import db, ITEMS_PER_PAGE, cache from flask_covid19.blueprints.app_all.all_model import BlueprintDateReported, BlueprintLocationGroup from flask_covid19.blueprints.app_all.all_model import BlueprintLocation, BlueprintFactTable @@ -19,7 +19,9 @@ class EcdcDateReported(BlueprintDateReported): def __repr__(self): return "%s(%s, %s, %s)" % (self.__class__.__name__, - self.date_reported_import_str, self.datum.isoformat(), self.year_day_of_year) + self.date_reported_import_str, + self.datum.isoformat(), + self.year_day_of_year) id = db.Column(db.Integer, primary_key=True) # @@ -78,7 +80,10 @@ class EcdcCountry(BlueprintLocation): def __repr__(self): return "%s(%s, %s, %s; %s, %s)" % (self.__class__.__name__, self.location_group.__repr__(), - self.location_code, self.location, self.pop_data_2019, self.geo_id) + self.location_code, + self.location, + self.pop_data_2019, + self.geo_id) def __str__(self): return " " + self.location_group.location_group \ @@ -151,7 +156,7 @@ class EcdcData(BlueprintFactTable): ) def __repr__(self): - return "%s(%s, %s)" % (self.__class__.__name__, self.date_reported_id, self.location_id) + return "%s(%s %s)" % (self.__class__.__name__, self.date_reported.__repr__(), self.location.__repr__()) id = db.Column(db.Integer, primary_key=True) date_reported_id = db.Column(db.Integer, db.ForeignKey('ecdc_date_reported.id'), nullable=False) diff --git a/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py b/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py index 1d651591d2aa8847560788c9c1dc3dac4a727349..46cdec1ba55d6be6457b0c90cb5e331b2606b697 100644 --- a/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py +++ b/src/flask_covid19/blueprints/data_ecdc/ecdc_model_import.py @@ -7,7 +7,11 @@ class EcdcImport(AllImport): __mapper_args__ = {'concrete': True} def __repr__(self): - return "%s(%s)" % (self.__class__.__name__, self.id) + return "%s(%s %s %s %s)" % (self.__class__.__name__, + self.date_reported_import_str, + self.datum.isoformat(), + self.countries_and_territories, + self.continent_exp) id = db.Column(db.Integer, primary_key=True) date_reported_import_str = db.Column(db.String(255), nullable=False) @@ -146,7 +150,11 @@ class EcdcFlat(AllFlat): __mapper_args__ = {'concrete': True} def __repr__(self): - return "%s(%s)" % (self.__class__.__name__, self.id) + return "%s(%s %s %s %s)" % (self.__class__.__name__, + self.date_reported_import_str, + self.datum.isoformat(), + self.location, + self.location_group.__repr__()) id = db.Column(db.Integer, primary_key=True) processed_update = db.Column(db.Boolean, nullable=False) diff --git a/src/flask_covid19/blueprints/data_owid/owid_model.py b/src/flask_covid19/blueprints/data_owid/owid_model.py index 48307e172b3b8e8048f1f17fcd510b422ab98309..70bdd68d6be0e4de7f1b721861a3800068fd1f45 100644 --- a/src/flask_covid19/blueprints/data_owid/owid_model.py +++ b/src/flask_covid19/blueprints/data_owid/owid_model.py @@ -69,8 +69,10 @@ class OwidCountry(BlueprintLocation): ) def __repr__(self): - return "%s(%s, %s, %s)" % (self.__class__.__name__, - self.location_group.__repr__(), self.location_code, self.location) + return "%s(%s %s %s)" % (self.__class__.__name__, + self.location_group.__repr__(), + self.location_code, + self.location) def __str__(self): result = "" + self.location_group.__str__() + " : " + self.location_code + " | " + self.location + " " @@ -147,7 +149,7 @@ class OwidData(BlueprintFactTable): ) def __repr__(self): - return "%s(%s %s)" % (self.__class__.__name__, self.date_reported_id, self.location_id) + return "%s(%s %s)" % (self.__class__.__name__, self.date_reported.__repr__(), self.location.__repr__()) id = db.Column(db.Integer, primary_key=True) date_reported_id = db.Column(db.Integer, db.ForeignKey('owid_date_reported.id'), nullable=False) diff --git a/src/flask_covid19/blueprints/data_vaccination/vaccination_model.py b/src/flask_covid19/blueprints/data_vaccination/vaccination_model.py index 8fbb0980aeec4f976d331d8d14572bac09680cb6..5cf58f5b850e84b56842452438cc6f5c8a8dd7d3 100644 --- a/src/flask_covid19/blueprints/data_vaccination/vaccination_model.py +++ b/src/flask_covid19/blueprints/data_vaccination/vaccination_model.py @@ -19,7 +19,9 @@ class VaccinationDateReported(BlueprintDateReported): def __repr__(self): return "%s(%s, %s, %s)" % (self.__class__.__name__, - self.date_reported_import_str, self.datum.isoformat(), self.year_day_of_year) + self.date_reported_import_str, + self.datum.isoformat(), + self.year_day_of_year) id = db.Column(db.Integer, primary_key=True) # @@ -48,7 +50,7 @@ class VaccinationData(BlueprintFactTableTimeSeries): ) def __repr__(self): - return "%s(%s)" % (self.__class__.__name__, self.date_reported_id) + return "%s(%s)" % (self.__class__.__name__, self.date_reported.__repr__()) id = db.Column(db.Integer, primary_key=True) date_reported_id = db.Column(db.Integer, db.ForeignKey('vaccination_date_reported.id'), nullable=False) diff --git a/src/flask_covid19/blueprints/data_vaccination/vaccination_model_import.py b/src/flask_covid19/blueprints/data_vaccination/vaccination_model_import.py index 9e6d23e31d4b131138755a48e92f98e95ad4b302..16753d17e2d9a01bea65f3ce5d7197f1a3544df1 100644 --- a/src/flask_covid19/blueprints/data_vaccination/vaccination_model_import.py +++ b/src/flask_covid19/blueprints/data_vaccination/vaccination_model_import.py @@ -7,7 +7,9 @@ class VaccinationImport(AllImport): __mapper_args__ = {'concrete': True} def __repr__(self): - return "%s(%s)" % (self.__class__.__name__, self.id) + return "%s(%s %s)" % (self.__class__.__name__, + self.date_reported_import_str, + self.datum.isoformat()) id = db.Column(db.Integer, primary_key=True) processed_update = db.Column(db.Boolean, nullable=False) @@ -141,7 +143,9 @@ class VaccinationFlat(AllImport): __mapper_args__ = {'concrete': True} def __repr__(self): - return "%s(%s)" % (self.__class__.__name__, self.id) + return "%s(%s %s)" % (self.__class__.__name__, + self.date_reported_import_str, + self.datum.isoformat()) id = db.Column(db.Integer, primary_key=True) processed_update = db.Column(db.Boolean, nullable=False)