pvl/verkko/web.py
changeset 24 45382e1c0be0
parent 16 51509b5ce1c0
child 26 589249097230
--- a/pvl/verkko/web.py	Wed Oct 24 18:09:42 2012 +0300
+++ b/pvl/verkko/web.py	Wed Oct 24 18:10:42 2012 +0300
@@ -24,12 +24,15 @@
     """
         Per-Request controller/view, containing the request context and generating the response.
     """
-    
+
     TITLE = None
     CSS = (
         #"/static/layout.css", 
         "/static/style.css", 
     )
+    JS = (
+        #"/static/jquery/jquery.js"
+    )
 
     def __init__ (self, app, request, urls, params) :
         """
@@ -87,6 +90,9 @@
                 html.title(title),
                 (
                     html.link(rel='Stylesheet', type="text/css", href=src) for src in self.CSS
+                ), 
+                (
+                    html.script(src=src, type='text/javascript', _selfclosing=False) for src in self.JS
                 ),
             ),
             html.body(
@@ -109,11 +115,15 @@
             Does an HTML layout'd response per default.
         """
         
-        # XXX: returning e.g. redirect?
-        self.process(**self.params)
+        # returning e.g. redirect?
+        response = self.process(**self.params)
+
+        if response :
+            return response
         
         # render as html per default
-        text = unicode(html.document(self.render_html()))
+        render = self.render_html()
+        text = unicode(html.document(render))
 
         return Response(text, mimetype='text/html')