]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Implement update_wrmapcache functionality from GUI.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 25 Oct 2019 14:58:25 +0000 (14:58 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 25 Oct 2019 14:58:25 +0000 (14:58 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2833 7aebc617-e5e2-0310-91dc-80fb5f6d2477

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

index ba056c1ec8f5d4f21d6b6a840e95af579469c270..c80fc17d6d08371e62d04ecad9d5c842263cc5f5 100644 (file)
@@ -54,6 +54,9 @@ def rodelbahn_update():
 def rodelbahn_update_regioncache():
     return RodelbahnController().update_regioncache()
 
+@app.route("/rodelbahn/update_mapcache")
+def rodelbahn_update_mapcache():
+    return RodelbahnController().update_mapcache()
 
 @app.route("/bericht/list")
 def bericht_list():
index 0b166fe8c272901651143ddc1ace0ff3c4a9c480..f6bd26d31acdc342f3bb7ff8c4890e2bfe0e5f28 100644 (file)
@@ -64,3 +64,15 @@ class RodelbahnController:
             flash(str(e), 'error')
         # Redirect to result page
         return redirect(url_for('rodelbahn_list'))
+
+    def update_mapcache(self):
+        """Updates the wrmappointcache and wrmappathcache tables from the wiki."""
+        c = model.meta.Session.connection()
+        try:
+            wrpylib.wrmwcache.update_wrmapcache(c)
+            model.meta.Session.commit()
+            flash('Die Landkarteninformationen aus dem Wiki wurden erfolgreich aktualisiesrt.', 'info')
+        except wrpylib.wrmwcache.UpdateCacheError as e:
+            flash(str(e), 'error')
+        # Redirect to result page
+        return redirect(url_for('rodelbahn_list'))
index e67900d4bc06f50800a0503b29c7477b7931af20..f011f3912bca23033ff94f9efdac69c25c701001 100644 (file)
@@ -8,6 +8,7 @@
 
 <a href="{{url_for('rodelbahn_update')}}" class="button">(1) Rodelbahnboxen auslesen und DB aktualisieren</a>
 <a href="{{url_for('rodelbahn_update_regioncache')}}" class="button">(2) Rodelbahnen in den Regionslisten aktualisieren</a>
+<a href="{{url_for('rodelbahn_update_mapcache')}}" class="button">(3) Landkarten aktualisieren</a>
 
 <p>{{paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last') | safe}}</p>