Hi there, if you can help me with this it will save what's left of my hair.

I want to have a jinja2 template render with variables passed in from an 
external program.  The views.py has this in it

@view_config(route_name='stats', renderer='templates/stats.jinja2')
def my_view_stats(request):
return {'r': subprocess.check_output(['program_that_returns_json']),
'page': 'My Stats', 'next' : '/hello', 'prev': '/paydown'}

program_that_returns_json returns this kind of thing {'on_target' : 3425}

The template stats.jinja2 has 
We are this much on target: {{r.on_target}} 
...
The next page is {{next}}

{{next}} gets rendered but {{r.on_target}} does not.

The technique above works for me when renderer='json' but I need javascript 
to unpack the response and jquery to set content, variable by variable.  
Here I have a large list of them.  Can it work like I have guessed or ?
Cheers
Craig.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/7541dfdb-307f-46a6-9c0e-1c755fc64295%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to