Changeset 5634
- Timestamp:
- 10/28/08 21:50:05 (2 months ago)
- Files:
-
- trunk/tg/controllers.py (modified) (3 diffs)
- trunk/tg/render.py (modified) (2 diffs)
- trunk/tg/tests/test_stack/rendering/controllers/root.py (modified) (1 diff)
- trunk/tg/tests/test_stack/test_config.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tg/controllers.py
r5598 r5634 206 206 expose decorator. 207 207 """ 208 208 209 209 content_type, engine_name, template_name, exclude_names = \ 210 210 controller.decoration.lookup_template_engine(pylons.request) … … 212 212 if content_type != CUSTOM_CONTENT_TYPE: 213 213 pylons.response.headers['Content-Type'] = content_type 214 215 #skip all the complicated stuff if we're just passing a string along. 216 if isinstance(response, basestring): 217 return response 218 214 219 # Save these objeccts as locals from the SOP to avoid expensive lookups 215 220 req = pylons.request._current_obj() … … 246 251 # has marked to be excluded. 247 252 namespace = dict(tmpl_context=tmpl_context) 248 namespace.update(response) 253 if isinstance(response, dict): 254 namespace.update(response) 249 255 if not engine_name in ['json']: 250 256 namespace.update(get_tg_vars()) trunk/tg/render.py
r5362 r5634 1 1 from pylons import (app_globals, config, session, tmpl_context, request, 2 2 response, templating) 3 from pylons import h as pylons_helpers4 3 import tg 5 4 from tg.configuration import Bunch … … 121 120 ) 122 121 123 helpers = config.get('pylons.h') or pylons_helpers._current_obj()122 helpers = config.get('pylons.h') or config.get('pylons.helpers') 124 123 125 124 root_vars = Bunch( trunk/tg/tests/test_stack/rendering/controllers/root.py
r5586 r5634 5 5 6 6 class RootController(TGController): 7 @expose( )7 @expose('index.html') 8 8 def index(self): 9 return "my foo"9 return {} 10 10 11 11 @expose() trunk/tg/tests/test_stack/test_config.py
r5585 r5634 18 18 19 19 def test_basic_stack(): 20 """Ensure that the tg stack returns a string"""21 20 app = setup_noDB() 22 21 resp = app.get('/')