diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-06-05 15:25:45 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-06-05 16:16:03 +0200 |
commit | 1c63ad5d352f5eb38a4d634b9aea84cbeee269a4 (patch) | |
tree | fadd0802b4e6952873446bffc39be273cc4d65ef /mediagoblin/util.py | |
parent | 99619a625b20d4c5825eeb52753657b088db5381 (diff) | |
download | mediagoblin-1c63ad5d352f5eb38a4d634b9aea84cbeee269a4.tar.lz mediagoblin-1c63ad5d352f5eb38a4d634b9aea84cbeee269a4.tar.xz mediagoblin-1c63ad5d352f5eb38a4d634b9aea84cbeee269a4.zip |
Create render_to_reponse and use it everywhere.
Just a shortcut for Response(render_template(...))
Diffstat (limited to 'mediagoblin/util.py')
-rw-r--r-- | mediagoblin/util.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py index 3649b6c3..f69c91f2 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -29,6 +29,7 @@ from babel.localedata import exists import jinja2 import translitcodec from paste.deploy.loadwsgi import NicerConfigParser +from webob import Response from mediagoblin import globals as mgoblin_globals from mediagoblin.db.util import ObjectId @@ -117,6 +118,11 @@ def clear_test_template_context(): TEMPLATE_TEST_CONTEXT = {} +def render_to_response(request, template, context): + """Much like Django's shortcut.render()""" + return Response(render_template(request, template, context)) + + def setup_user_in_request(request): """ Examine a request and tack on a request.user parameter if that's |