diff --git a/README.md b/README.md index 783a455f4e8952845150e4f6771be890f6b19810..3108ca20e5b305e85fdf82ddc5ed3324c791ebc4 100644 --- a/README.md +++ b/README.md @@ -221,21 +221,21 @@ class WhoGlobalDataImportTable(db.Model): * Fixed #43 /europe/date_reported * Fixed #44 /europe/continent * Fixed #45 /europe/country -* Issue #46 /europe/country/germany +* Fixed #46 /europe/country/germany +* Fixed #50 remove unused requirements from requirements.txt +* Fixed #51 /europe/imported + +### 0.0.12 Release +* Issue #28 /admin/database/import * Issue #39 SQLalchemy instead of SQL: AllModelClasses.remove_all() * Issue #40 SQLalchemy instead of SQL: EuropeDataImportTable.get_date_rep() * Issue #41 SQLalchemy instead of SQL: EuropeDataImportTable.get_countries_of_continent() * Issue #42 SQLalchemy instead of SQL: WhoGlobalDataImportTable.get_new_dates_as_array() * Issue #49 EuropeServiceUpdate.__update_data_short() -* Issue #50 remove unused requirements from requirements.txt -* Issue #51 /europe/imported - -### 0.0.12 Release -* Issue #5 Visual Graphs for Data per Countries order by Date -* Issue #28 /admin/database/import ### 0.0.13 Release * Issue #47 refactor Routes from app.py to org...who,europe,... * Issue #48 refactor Tasks from server_mq.py to org...who,europe,... - +### 0.0.14 Release +* Issue #5 Visual Graphs for Data per Countries order by Date diff --git a/app.py b/app.py index 54f4703e391a523c4b1da0ea35097d5309cab1ae..0ef66d7cd2239459ab2df1c2917cbd2555874cc5 100644 --- a/app.py +++ b/app.py @@ -374,8 +374,8 @@ def url_europe_country_one(country_id, page=1): @app.route('/europe/country/germany/page/<int:page>') @app.route('/europe/country/germany') -def url_europe_country_germany(country_id, page=1): - page_info = ApplicationPage('Europe', "country") +def url_europe_country_germany(page=1): + page_info = ApplicationPage('Europe', "country: Germany") europe_country = EuropeCountry.get_germany() page_data = EuropeData.find_by_country(europe_country, page) return render_template( @@ -385,17 +385,6 @@ def url_europe_country_germany(country_id, page=1): page_info=page_info) -#@app.route('/europe/data/page/<int:page>') -#@app.route('/europe/data') -#def url_europe_data(page=1): -# page_info = ApplicationPage('Europe', "europe_data") -# page_data = EuropeData.get_all_as_page(page) -# return render_template( -# 'europe/europe_data.html', -# page_data=page_data, -# page_info=page_info) -# -# ################################################################################################################## # # RKI diff --git a/org/woehlke/covid19/europe/europe_model.py b/org/woehlke/covid19/europe/europe_model.py index 7c004871ec8a1dd3871f399fd0b5ee8222d237ac..2a8e153eacb69ec5784b44cb44b91aead4f5a874 100644 --- a/org/woehlke/covid19/europe/europe_model.py +++ b/org/woehlke/covid19/europe/europe_model.py @@ -187,8 +187,9 @@ class EuropeCountry(db.Model): @classmethod def get_germany(cls): - #TODO: - pass + return db.session.query(cls) \ + .filter(cls.country_territory_code == 'DEU') \ + .one() class EuropeData(db.Model): diff --git a/templates/europe/europe_country_germany.html b/templates/europe/europe_country_germany.html index 0dcb194cb9b932aa9d8574e9db27716df0cc575b..dec2e141a41516b7da67b1d01d83c893f7b1183e 100644 --- a/templates/europe/europe_country_germany.html +++ b/templates/europe/europe_country_germany.html @@ -11,9 +11,7 @@ {% if page_data.has_prev %} <li class="page-item"> <a class="page-link" - href="{{ url_for( 'url_europe_country_germany', - country_id=europe_country.id, - page=page_data.prev_num) }}"> + href="{{ url_for( 'url_europe_country_germany', page=page_data.prev_num) }}"> Previous </a> </li> @@ -23,9 +21,7 @@ {% if page_num != page_data.page %} <li class="page-item"> <a class="page-link" - href="{{ url_for( 'url_europe_country_germany', - country_id=europe_country.id, - page=page_num) }}"> + href="{{ url_for( 'url_europe_country_germany', page=page_num) }}"> {{ page_num }} </a> </li> @@ -43,8 +39,7 @@ {% if page_data.has_next %} <li class="page-item"> <a class="page-link" - href="{{ url_for( 'url_europe_country_germany', - country_id=europe_country.id, page=page_data.next_num) }}"> + href="{{ url_for( 'url_europe_country_germany', page=page_data.next_num) }}"> Next </a> </li> diff --git a/templates/fragment_navtabs_europe.html b/templates/fragment_navtabs_europe.html index a4ff34476036ebfeb9363202c724fe4ee7976ade..c1f3f02852c2ee1acd0815bae8eaafdfa110a2d2 100644 --- a/templates/fragment_navtabs_europe.html +++ b/templates/fragment_navtabs_europe.html @@ -15,6 +15,9 @@ <li class="nav-item"> <a class="nav-link" href="/europe/country/all">Europe country</a> </li> + <li class="nav-item"> + <a class="nav-link" href="/europe/country/germany">Europe Germany</a> + </li> <li class="nav-item"> <a class="nav-link" href="/europe/imported">Europe imported</a> </li>