Not sure why you would want to avoid dictionary objects, but it's
actually simpler imo to pass objects to mako in Pyramid. I believe
you want something like:
-- users.py --
@view_config(renderer='users.mako)'
def index(self):
users = session.query(User).all()
return {'users': users}
-- users.mako --
<table>
% for user in users:
<tr></tr>
%endfor
</table>
On May 30, 8:33 pm, Jojo <[email protected]> wrote:
> hi guys, I'm from pylons.
> In pylons i was usual pass objects to mako templates through the "c"
> object.
>
> Just like:
>
> -- users.py --
> def index(self):
> c.users = session.query(User).all()
> return render('users.mako')
>
> -- users.mako --
> <table>
> % for user in c.users:
> <tr></tr>
> %endfor
> </table>
>
> How can i do this in pyramid?
> I prefer avoid to pass dictionary objects.
>
> Thanks
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.