From 592f8e3ef67c9deda0cd1dd082eeb3e28bb64edb Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Fri, 22 Jan 2021 17:51:51 +0100
Subject: [PATCH] ### 0.0.11 Release * Issue #43 /europe/date_reported * Issue
 #44 /europe/continent * Issue #45 /europe/country * Issue #46 /europe/data *
 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 #47 refactor Routes
 from app.py to org...who,europe,... * Issue #48 refactor Tasks from
 server_mq.py to org...who,europe,...

---
 app.py                                         | 13 +++++++++++++
 org/woehlke/covid19/europe/europe_model.py     |  5 +++++
 templates/europe/europe_date_reported_one.html |  0
 3 files changed, 18 insertions(+)
 create mode 100644 templates/europe/europe_date_reported_one.html

diff --git a/app.py b/app.py
index 66a2fea2..5c7e2deb 100644
--- a/app.py
+++ b/app.py
@@ -283,6 +283,19 @@ def url_europe_date_reported(page=1):
         page_info=page_info)
 
 
+@app.route('/europe/date_reported/<int:europe_date_reported_id>/page/<int:page>')
+@app.route('/europe/date_reported/<int:europe_date_reported_id>')
+def url_europe_date_reported_one(europe_date_reported_id, page=1):
+    page_info = ApplicationPage('Europe', "date_reported")
+    europe_date_reported = EuropeDateReported.get_by_id(europe_date_reported_id)
+    page_data = EuropeData.find_by_date_reported(europe_date_reported)
+    return render_template(
+        'europe/europe_date_reported_one.html',
+        europe_date_reported=europe_date_reported,
+        page_data=page_data,
+        page_info=page_info)
+
+
 @app.route('/europe/continent/page/<int:page>')
 @app.route('/europe/continent')
 def url_europe_continent(page=1):
diff --git a/org/woehlke/covid19/europe/europe_model.py b/org/woehlke/covid19/europe/europe_model.py
index 257f0780..fa815a1c 100644
--- a/org/woehlke/covid19/europe/europe_model.py
+++ b/org/woehlke/covid19/europe/europe_model.py
@@ -212,3 +212,8 @@ class EuropeData(db.Model):
     def get_by_id(cls, other_id):
         return db.session.query(cls).filter(cls.id == other_id).one()
 
+    @classmethod
+    def find_by_date_reported(cls, europe_date_reported):
+        return db.session.query(cls).filter(
+            cls.europe_date_reported_id == europe_date_reported.id).all()
+
diff --git a/templates/europe/europe_date_reported_one.html b/templates/europe/europe_date_reported_one.html
new file mode 100644
index 00000000..e69de29b
-- 
GitLab