]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
gaushaus_view is rendered now.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 27 Jul 2017 22:01:30 +0000 (22:01 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 27 Jul 2017 22:01:30 +0000 (22:01 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2681 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wradmin/__init__.py
wradmin/controllers/gasthaus.py

index c2c8addf03320e56bb06cbbfe9e8ad65530a483c..9fe699d954ff76847ab46a86aa4dff21015dc4e8 100644 (file)
@@ -78,7 +78,7 @@ def gasthaus_list():
 
 
 @app.route("/gasthaus/view/<int:id>")
-def gasthaus_view():
+def gasthaus_view(id):
     get_db()
     return GasthausController().view(id)
 
index 4ecb1520aa6bbad8c67d7778581f0a2920a22b6d..bf19ad0a5d891e6640f3def6acb9e48d59717324 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/python3.4
 #from pylons import request, response, session, url, tmpl_context as c
 #from pylons.controllers.util import abort, redirect
-from flask import request
+from flask import request, abort
 import paginate
 import sqlalchemy as sa
 
@@ -22,14 +22,15 @@ class GasthausController:
         c = TemplateContext()
         c.paginator = paginate.Page(q.all(), page=int(request.args.get('page', 1)), items_per_page = 25)
         return render_genshi_template('gasthaus_list.html', c=c)
-    
-    
+
     def view(self, id):
-        "Displays an inn"
+        """Displays an inn"""
         q = model.meta.Session.query(model.WrInnCache)
+        c = TemplateContext()
         c.inn =  q.get(id)
-        if c.inn is None: abort(404)
-        return render('gasthaus_view.html')
+        if c.inn is None:
+            abort(404)
+        return render_genshi_template('gasthaus_view.html', c=c)
     
     
     def update(self):