Skip to content
Snippets Groups Projects
Commit 96047d64 authored by thomaswoehlke's avatar thomaswoehlke
Browse files

work

parent 27263567
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,27 @@ class EuropeDateReported(db.Model):
day_of_week = db.Column(db.Integer, nullable=False)
week_of_year = db.Column(db.Integer, nullable=False)
def get_name_for_datum(self):
result = ""
if self.day_of_month < 10:
result += "0" + str(self.day_of_month)
else:
result += "" + str(self.day_of_month)
if self.month < 10:
result += ".0" + str(self.month)
else:
result += "." + str(self.month)
result += "." + str(self.year)
return result
def get_name_for_weekday(self):
return self.get_names_for_weekday()[self.day_of_week]
@classmethod
def get_names_for_weekday(cls):
return {1: "Montag", 2: "Dienstag", 3: "Mittwoch", 4: "Donnerstag", 5: "Freitag", 6: "Samstag",
7: "Sonntag"}
@classmethod
def create_new_object_factory(cls, my_date_rep, my_year_week):
my_date_reported = my_date_rep.split('/')
......
......@@ -10,13 +10,13 @@
<a class="nav-link" href="/europe/date_reported/all">Europe date_reported</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/europe/continent/all">Europe continent</a>
<a class="nav-link" href="/europe/country/germany">Europe Germany</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/europe/country/all">Europe country</a>
<a class="nav-link" href="/europe/continent/all">Europe continent</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/europe/country/germany">Europe Germany</a>
<a class="nav-link" href="/europe/country/all">Europe country</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/europe/imported">Europe imported</a>
......
<table class="table table-hover table-striped table-dark">
<thead>
<tr>
<th scope="col">continent</th>
</tr>
<thead class="table-secondary">
<tr>
<th scope="col">continent</th>
</tr>
</thead>
<tbody>
{% for europe_continent in page_data.items %}
......
<table class="table table-hover table-striped table-dark">
<thead>
<tr>
<th scope="col">countries and territories</th>
<th scope="col">population data 2019</th>
<th scope="col">geo id</th>
<th scope="col">country territory code</th>
<th scope="col">continent</th>
</tr>
<thead class="table-secondary">
<tr>
<th scope="col">countries and territories</th>
<th scope="col">population data 2019</th>
<th scope="col">geo id</th>
<th scope="col">country territory code</th>
<th scope="col">continent</th>
</tr>
</thead>
<tbody>
{% for europe_country in page_data.items %}
......
......@@ -5,11 +5,11 @@
<th scope="col">year_week</th>
<th scope="col">
{% if europe_date_reported %}
<a href="{{ url_for( 'url_europe_date_reported_one_deaths_weekly',
europe_date_reported_id=europe_date_reported.id,
page=page_data.page) }}">
deaths weekly
</a>
<a href="{{ url_for( 'url_europe_date_reported_one_deaths_weekly',
europe_date_reported_id=europe_date_reported.id,
page=page_data.page) }}">
deaths weekly
</a>
{% endif %}
{% if europe_country %}
deaths weekly
......@@ -17,11 +17,11 @@
</th>
<th scope="col">
{% if europe_date_reported %}
<a href="{{ url_for( 'url_europe_date_reported_one_cases_weekly',
europe_date_reported_id=europe_date_reported.id,
page=page_data.page) }}">
cases weekly
</a>
<a href="{{ url_for( 'url_europe_date_reported_one_cases_weekly',
europe_date_reported_id=europe_date_reported.id,
page=page_data.page) }}">
cases weekly
</a>
{% endif %}
{% if europe_country %}
cases weekly
......@@ -29,11 +29,11 @@
</th>
<th scope="col">
{% if europe_date_reported %}
<a href="{{ url_for( 'url_europe_date_reported_one_notification_rate',
europe_date_reported_id=europe_date_reported.id,
page=page_data.page) }}">
notification rate per 100000 population 14days
</a>
<a href="{{ url_for( 'url_europe_date_reported_one_notification_rate',
europe_date_reported_id=europe_date_reported.id,
page=page_data.page) }}">
notification rate per 100000 population 14days
</a>
{% endif %}
{% if europe_country %}
notification rate per 100000 population 14days
......@@ -51,7 +51,7 @@
<tr>
<td>
<a href="/europe/date_reported/{{ europe_data.europe_date_reported.id }}">
{{ europe_data.europe_date_reported.date_rep }}
{{ europe_data.europe_date_reported.get_name_for_datum() }}
</a>
</td>
<td>
......
<table class="table table-hover table-striped table-dark">
<thead>
<tr>
<th scope="col">date reported</th>
<th scope="col">year week</th>
</tr>
<thead class="table-secondary">
<tr>
<th scope="col">date reported</th>
<th scope="col">year week</th>
</tr>
</thead>
<tbody>
{% for europe_date_reported in page_data.items %}
<tr>
<td>
<a href="/europe/date_reported/{{ europe_date_reported.id }}">
{{ europe_date_reported.date_rep }}
{{ europe_date_reported.get_name_for_datum() }}
</a>
</td>
<td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment