--- a/svv/controllers.py Thu Dec 23 01:07:42 2010 +0200
+++ b/svv/controllers.py Thu Dec 23 02:22:34 2010 +0200
@@ -137,12 +137,8 @@
)
# perform the actual rendering (run generators etc.)
- html_text = unicode(html.document(head, layout))
+ return unicode(html.document(head, layout))
- # response object
- # XXX: unicode?
- return Response(html_text, mimetype='text/html')
-
def render (self, **url_values) :
"""
Render full page HTML
@@ -158,15 +154,23 @@
return response
def respond (self, url_values) :
- response = None
+ """
+ Build and return a response from the following steps:
- if self.request.form :
- # process POST data for e.g. redirect
- response = self.process(**url_values)
+ * process()
+ * render() -> render_content() as HTML
+ """
+
+ # process e.g. POST data for e.g. redirect
+ response = self.process(**url_values)
if not response :
# render page HTML
- response = self.render(**url_values)
+ html = self.render(**url_values)
+
+ # response object
+ # XXX: unicode?
+ return Response(html, mimetype='text/html')
# ok
return response