On Sun, 2011-06-12 at 13:21 -0700, AwaisMuzaffar wrote: > Could someone please tell me how one can make table classes and > 'dbsession()' created using sqlalchemy in pyramid available globally, > so I can query those tables within my templates.
For the full-on PHP experience, use the pattern described in <http://docs.pylonsproject.org/projects/pyramid_cookbook/dev/templates.html#using-a-before-render-event-to-expose-an-h-helper-object> and import the DBSession into your helpers.py module, then from a template, query the databse via "h.DBSession.query(...)" By the way, I had to moderate your message so the list sees it. You need to subscribe before posting. No one will see your followups if you don't. - C -- 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.
