[Grok-dev] Re: Neanderthal sprint topics
Philipp von Weitershausen
philipp at weitershausen.de
Tue Oct 2 12:09:51 EDT 2007
On 2 Oct 2007, at 17:41 , Lennart Regebro wrote:
> On 10/2/07, Philipp von Weitershausen <philipp at weitershausen.de>
> wrote:
>> 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.
>
> Not being a Genshi developer, I wouldn't know what is natural. :-)
Great... Looks like we should obduct somebody from the other web
frameworks ;).
>> 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'.
>
> So far so good. :-) We probably need to make the push story
> slightly simpler.
> But basically, it works now, except of course, you don't have any path
> expressions, mening you can't find any other views an call them, and
> that would be useful.
I don't think that's necessarily a bad thing. You're not really
supposed to do too many fancy things in templates anyway. And you'll
always have view.url() to compute URLs, so no need for
@@absolute_url. Then we only need to make resources work, possibly
also through a convenience method on the view or so. That should get
most of the stuff covered.
More information about the Grok-dev
mailing list