Skip to content
Snippets Groups Projects
Commit 3d6a20da authored by Thomas Wöhlke's avatar Thomas Wöhlke :alien:
Browse files

Default task

parent 27af99fb
No related branches found
No related tags found
No related merge requests found
...@@ -118,8 +118,8 @@ class OwidImport(db.Model): ...@@ -118,8 +118,8 @@ class OwidImport(db.Model):
return cls.get_dates_reported_as_array() return cls.get_dates_reported_as_array()
@classmethod @classmethod
def get_continents(cls): def get_continents(cls, page):
return db.session.query(cls.continent)\ return db.session.query(cls.continent)\
.order_by(cls.date.desc()) \ .order_by(cls.date.desc()) \
.group_by(cls.date) \ .group_by(cls.date) \
.distinct() .distinct().paginate(page, per_page=ITEMS_PER_PAGE)
...@@ -53,9 +53,9 @@ def url_owid_tasks(): ...@@ -53,9 +53,9 @@ def url_owid_tasks():
def url_owid_test(page=1): def url_owid_test(page=1):
page_info = ApplicationPage('OWID', "Test") page_info = ApplicationPage('OWID', "Test")
try: try:
page_data = OwidImport.get_continents() page_data = OwidImport.get_continents(page)
except OperationalError: except OperationalError:
flash("No data in the database.") flash(message="No data in the database.", category="error")
page_data = None page_data = None
return render_template( return render_template(
'owid/owid_test.html', 'owid/owid_test.html',
......
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