From 5a816bef9a56424b6b9ee0aa3069fe4794f9a77a Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Sat, 23 Jan 2021 13:13:35 +0100
Subject: [PATCH] ### 0.0.11 Release * Fixed #26 /admin/database/dump * Fixed
 #43 /europe/date_reported * Fixed #44 /europe/continent * Fixed #45
 /europe/country * 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()

### 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
---
 README.md                                    | 16 ++++++++--------
 app.py                                       | 15 ++-------------
 org/woehlke/covid19/europe/europe_model.py   |  5 +++--
 templates/europe/europe_country_germany.html | 11 +++--------
 templates/fragment_navtabs_europe.html       |  3 +++
 5 files changed, 19 insertions(+), 31 deletions(-)

diff --git a/README.md b/README.md
index 783a455f..3108ca20 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 54f4703e..0ef66d7c 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 7c004871..2a8e153e 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 0dcb194c..dec2e141 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 a4ff3447..c1f3f028 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>
-- 
GitLab