return BerichtController().change_date_invalid(id)
+@app.route("/bericht/update_reportcache")
+def bericht_update_reportcache():
+ return BerichtController().update_reportcache()
+
+
@app.route("/gasthaus/list")
def gasthaus_list():
return GasthausController().list()
import paginate
import sqlalchemy as sa
import wradmin.model as model
+import wrpylib.wrmwcache
class BerichtController:
model.meta.Session.commit()
flash('Datum wurde erfolgreich geƤndert')
return redirect(url_for('bericht_view', id=id))
+
+ def update_reportcache(self):
+ """Updates the wrreportcache table."""
+ c = model.meta.Session.connection()
+ try:
+ wrpylib.wrmwcache.update_wrreportcache(c)
+ model.meta.Session.commit()
+ flash('Die Berichtzusammenfassung-Tabelle wurde erfolgreich aktualisiesrt.', 'info')
+ except wrpylib.wrmwcache.UpdateCacheError as e:
+ flash(str(e), 'error')
+ # Redirect to result page
+ return redirect(url_for('bericht_list'))
{% block content %}
<h2>Rodelbahnberichte</h2>
+<a href="{{url_for('bericht_update_reportcache')}}" class="button">Berichtzusammenfassung aktualisieren</a>
+
+
<p>{{paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last') | safe}}</p>
<table>