Changeset 5125

Show
Ignore:
Timestamp:
08/10/08 16:12:56 (5 months ago)
Author:
mramm
Message:

Updating the root namspace of rendered templates with more commonly used variables.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tg/render.py

    r4917 r5125  
    116116        errors = getattr(tmpl_context, "form_errors", {}), 
    117117        inputs = getattr(tmpl_context, "form_values", {}), 
    118         request = tg.request) 
    119     
    120     root_vars = {} 
    121     root_vars.update({'tg':tg_vars}) 
     118        request = tg.request 
     119        ) 
     120         
     121    root_vars = Bunch( 
     122        c=pylons.tmpl_context, 
     123        tmpl_context = pylons.tmpl_context, 
     124        response = pylons.response, 
     125        request = pylons.request, 
     126        helpers=pylons.helpers, 
     127        h=pylons.helpers, 
     128        tg=tg_vars 
     129        ) 
    122130    return root_vars 
    123131