Hello mate,

I want to display a JSON in the view and here is what I do:
*- In the view.py:*
@view_config(route_name='display', renderer='json' )#, 
renderer='templates/display_user.jinja2')
def display_user(request):
       * # I get listUser from the DB*
*        # I print the listUser  and I can see the list in the terminal*
        print dumps(listUser)
return {'listUser':  dumps(listUser)}

*- In the display_user.jinja2, here is what I do:*
{% for user in listUser %}
  {{ user}}
{% endfor %}

_____________
When I run the code nothing is display in the front-end. Is shows an empty 
JSON which doesn't make sense to me because in the back-end I can see the 
list when I do the print.

Thank You for your help
Yannick P.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to