Question

For my site need some "widgets" that elaborate output from various data models, because this widgets are visible in any page is possible with mako to retrieve the data without pass (and elaborate) every time with render() in controllers?

Was it helpful?

Solution

May be you need use helpers

in lib/helpers.py

def tweets(**params):
   context = {}
   return render('tweets.mako', context)

In you page template do this to render you tweets widget:

   h.tweets()

OTHER TIPS

It sounds like you're looking for some combination of FormAlchemy, ToscaWidgets and/or Sprox. I would check out those three.
Also, you might read Chapter 6 of http://pylonsbook.com/en/1.1/ . It helped me a bunch; maybe you'll get something out of it as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top