diff --git a/data b/data index 531dfba44da588141f4f7310501d7a37fffe2cf3..30c363b5c5d82f90b68f11f8352a021e64b90990 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 531dfba44da588141f4f7310501d7a37fffe2cf3 +Subproject commit 30c363b5c5d82f90b68f11f8352a021e64b90990 diff --git a/src/flask_covid19/blueprints/data_who/who_model.py b/src/flask_covid19/blueprints/data_who/who_model.py index 97875f1bc7ff32c0522d3f72d16267086afcb93f..c537854296f22c7edba28eea28b6d5a89a213345 100644 --- a/src/flask_covid19/blueprints/data_who/who_model.py +++ b/src/flask_covid19/blueprints/data_who/who_model.py @@ -113,7 +113,7 @@ class WhoCountry(BlueprintLocation): ).one() @classmethod - def find_by_location_group(cls, location_group: WhoCountryRegion, page: int): + def find_by_location_group(cls, location_group: WhoCountryRegion): return db.session.query(cls).filter( cls.location_group == location_group ).order_by(cls.location).all() diff --git a/src/flask_covid19/blueprints/data_who/who_views.py b/src/flask_covid19/blueprints/data_who/who_views.py index 259d5ef77cc099a568fcdae5a44f40418b288f7b..f349ac1c435a7f407c3629e9ecdc535fd4f70bf3 100644 --- a/src/flask_covid19/blueprints/data_who/who_views.py +++ b/src/flask_covid19/blueprints/data_who/who_views.py @@ -103,7 +103,7 @@ def url_who_date_reported(date_reported_id: int, page: int = 1): "data of all reported countries for WHO date reported " + str(date_reported) + " " ) try: - page_data = WhoData.get_data_for_day(date_reported, page) + page_data = WhoData.get_by_date_reported(date_reported, page) except OperationalError: flash("No data in the database.") page_data = None @@ -124,7 +124,7 @@ def url_who_date_reported_cases_new(date_reported_id: int, page: int = 1): "data of all reported countries for WHO date reported " + str(date_reported) + " " ) try: - page_data = WhoData.find_by_datum_order_by_cases_new(date_reported, page) + page_data = WhoData.get_by_date_reported_order_by_cases_new(date_reported, page) except OperationalError: flash("No data in the database.") page_data = None @@ -145,7 +145,7 @@ def url_who_date_reported_cases_cumulative(date_reported_id: int, page: int = 1) "data of all reported countries for WHO date reported " + str(date_reported) + " " ) try: - page_data = WhoData.find_by_location_order_by_cases_cumulative(date_reported, page) + page_data = WhoData.get_by_location_order_by_cases_cumulative(date_reported, page) except OperationalError: flash("No data in the database.") page_data = None @@ -166,7 +166,7 @@ def url_who_date_reported_deaths_new(date_reported_id: int, page: int = 1): "data of all reported countries for WHO date reported " + str(date_reported) + " " ) try: - page_data = WhoData.find_by_datum_order_by_deaths_new(date_reported, page) + page_data = WhoData.get_by_date_reported_order_by_deaths_new(date_reported, page) except OperationalError: flash("No data in the database.") page_data = None @@ -187,7 +187,7 @@ def url_who_date_reported_deaths_cumulative(date_reported_id: int, page: int = 1 "data of all reported countries for WHO date reported " + str(date_reported) + " " ) try: - page_data = WhoData.find_by_datum_order_by_deaths_cumulative(date_reported, page) + page_data = WhoData.get_by_date_reported_order_by_deaths_cumulative(date_reported, page) except OperationalError: flash("No data in the database.") page_data = None @@ -220,7 +220,7 @@ def url_who_region(region_id: int, page: int = 1): page_info = WebPageContent("Countries", "WHO Region") try: who_region = WhoCountryRegion.get_by_id(region_id) - page_data = WhoCountry.get_who_countries_for_region(who_region, page) + page_data = WhoCountry.get_by_location_group(who_region, page) page_info.title = str(who_region) page_info.subtitle = "WHO Region" page_info.subtitle_info = "Countries of WHO Region " + str(who_region) @@ -253,7 +253,7 @@ def url_who_country_all(page: int = 1): @app_who.route('/country/<int:country_id>') def url_who_country(country_id: int, page: int = 1): who_country = WhoCountry.get_by_id(country_id) - page_data = WhoData.get_data_for_country(who_country, page) + page_data = WhoData.get_by_location(who_country, page) page_info = WebPageContent(who_country.location, "Country " + who_country.location, "Data per Day in Country " + str(who_country)) @@ -268,7 +268,7 @@ def url_who_country(country_id: int, page: int = 1): @app_who.route('/country/<int:country_id>/cases_new') def url_who_country_cases_new(country_id: int, page: int = 1): who_country = WhoCountry.get_by_id(country_id) - page_data = WhoData.find_by_location_order_by_cases_new(who_country, page) + page_data = WhoData.get_by_location_order_by_cases_new(who_country, page) page_info = WebPageContent(who_country.location, "Country " + who_country.location, "Data per Day in Country " + str(who_country)) @@ -283,7 +283,7 @@ def url_who_country_cases_new(country_id: int, page: int = 1): @app_who.route('/country/<int:country_id>/cases_cumulative') def url_who_country_cases_cumulative(country_id: int, page: int = 1): who_country = WhoCountry.get_by_id(country_id) - page_data = WhoData.find_by_location_order_by_cases_cumulative(who_country, page) + page_data = WhoData.get_by_location_order_by_cases_cumulative(who_country, page) page_info = WebPageContent(who_country.location, "Country " + who_country.location, "Data per Day in Country " + str(who_country)) @@ -298,7 +298,7 @@ def url_who_country_cases_cumulative(country_id: int, page: int = 1): @app_who.route('/country/<int:country_id>/deaths_new') def url_who_country_deaths_new(country_id: int, page: int = 1): who_country = WhoCountry.get_by_id(country_id) - page_data = WhoData.find_by_location_order_by_deaths_new(who_country, page) + page_data = WhoData.get_by_location_order_by_deaths_new(who_country, page) page_info = WebPageContent(who_country.location, "Country " + who_country.location, "Data per Day in Country " + str(who_country)) @@ -313,7 +313,7 @@ def url_who_country_deaths_new(country_id: int, page: int = 1): @app_who.route('/country/<int:country_id>/deaths_cumulative') def url_who_country_deaths_cumulative(country_id: int, page: int = 1): who_country = WhoCountry.get_by_id(country_id) - page_data = WhoData.find_by_location_order_by_deaths_cumulative(who_country, page) + page_data = WhoData.get_by_location_order_by_deaths_cumulative(who_country, page) page_info = WebPageContent(who_country.location, "Country " + who_country.location, "Data per Day in Country " + str(who_country)) @@ -332,7 +332,7 @@ def url_who_germany(page: int = 1): if who_country_germany is None: flash('country: Germany not found in Database', category='error') return redirect(url_for('who.url_who_info')) - page_data = WhoData.find_page_by_location(who_country_germany, page) + page_data = WhoData.get_by_location(who_country_germany, page) return render_template( 'who/country/germany/who_country_germany.html', who_country=who_country_germany,