]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Added possibility to update regioncache.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 4 Apr 2014 13:01:37 +0000 (13:01 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 4 Apr 2014 13:01:37 +0000 (13:01 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@1954 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wradmin/controllers/rodelbahn.py
wradmin/templates/rodelbahn_list.html

index 71d5bc2f449c43234accf24f52021f2962801cd6..8f1c2e91b5c01ff6b6c300e962b114658f5d75c6 100644 (file)
@@ -65,3 +65,17 @@ class RodelbahnController(BaseController):
         # Redirect to result page
         return redirect(url(controller='rodelbahn', action='list'))
 
+
+    def update_regioncache(self):
+        "Updates the wrregioncache table from the wiki"
+        c = model.meta.Session.connection()
+        try:
+            wrpylib.wrmwcache.update_wrregioncache(c)
+            model.meta.Session.commit()
+            session['flash'] = u'Die Rodelbahneinträge in den Regionslisten wurden erfolgreich aktualisiert.'
+        except wrpylib.wrmwcache.UpdateCacheError as e:
+            session['flash'] = unicode(e)
+        session.save()
+        # Redirect to result page
+        return redirect(url(controller='rodelbahn', action='list'))
+
index 864fe620a37069bc2d920714057e8baeceac8bc4..bb733606c9ca5cd5353f0f800c15279f0295b702 100644 (file)
@@ -15,7 +15,8 @@
 
 <p>Die folgende Lise wurde automatisiert von den Rodelbahnboxen gesammelt. Da dies nicht automatisch passiert, kann es sein, dass die Liste "veraltete" Information enthält.</p>
 
-<a href="${h.url(controller='rodelbahn', action='update')}" class="button">Rodelbahnboxen auslesen und DB aktualisieren</a>
+<a href="${h.url(controller='rodelbahn', action='update')}" class="button">(1) Rodelbahnboxen auslesen und DB aktualisieren</a>
+<a href="${h.url(controller='rodelbahn', action='update_regioncache')}" class="button">(2) Rodelbahnen in den Regionslisten aktualisieren</a>
 
 <p>${c.paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last', controller='rodelbahn', action='list')}</p>