[Grok-dev] Re: Neanderthal sprint topics
Philipp von Weitershausen
philipp at weitershausen.de
Tue Oct 2 10:00:25 EDT 2007
On 2 Oct 2007, at 11:33 , Lennart Regebro wrote:
> On 9/28/07, Philipp von Weitershausen <philipp at weitershausen.de>
>> By the way, I looked at integrating Genshi into Zope 3 the other day.
>> It's shockingly easy. Takes you about 3 lines of code. I wouldn't
>> ditching PageTemplates (at least as the preferred option) altogether
>> since Genshi
> We are going too look at integrating other templating languages today,
> starting with Genshi. So... do you have any hints of how to do this?
Not really. I just did a very simple hack to get Genshi working. I
don't know it well enough by far to suggest some good patterns. All I
know is that it should feel natural to Grok *and* Genshi developers.
Genshi uses the "push" model for templates (the view code pushes the
data that the template needs into the template, rather than ZPTs
fetching the data they need). I very much like "push". In Grok we
typically have "semi-push" where the view class prepares data as
attributes of self in update() and the the template accesses it as
view.foo. So Genshi templates need to at least get the 'view' object,
and the 'request' probably too. Perhaps 'context'. But really, I
think everything else should be "pushed" in from the view class.
More information about the Grok-dev