[Grok-dev] Re: Neanderthal sprint topics
faassen at startifact.com
Tue Oct 2 13:18:39 EDT 2007
Philipp von Weitershausen wrote:
> On 2 Oct 2007, at 17:41 , Lennart Regebro wrote:
>>> 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
>> 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.
'static' doesn't work. That's a bad thing. :)
In general, I don't think we should make this difficult deliberately. We
should push in a helper function that allows you to easily do this.
On it being a push model, we push the context, request and view to the
template. :) Genshi doesn't really require anything. It might be nice to
also *in addition* push in other things easily, though of course we
already have the update() method to set things up on the view.
More information about the Grok-dev