byterussian
byterussian

Reputation: 3619

Template tags like Django with Mako and Pylons

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?

Upvotes: 1

Views: 287

Answers (2)

estin
estin

Reputation: 3121

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()

Upvotes: 2

yarmiganosca
yarmiganosca

Reputation: 2341

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.

Upvotes: 0

Related Questions