[Grok-dev] Re: issue #226555: viewlet.url() and how to solve it
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Sat May 10 03:48:51 EDT 2008
Philipp von Weitershausen wrote:
> Jan-Wijbrand Kolman wrote:
>> Kevin Smith wrote:
>>> Thinking out loud, it may be possible in a viewlet to map the 'view'
>>> namespace directly to the parent view and then supply a 'viewlet'
>>> namespace that maps directly to the viewlet.
>>
>> Like the others I'm quite fond of this idea too.
>>
>> This would actually mean, we do not need to supply a url() method on
>> viewlet(managers) after all, because you have easy access to the view
>> and thus you can easily (and completely similar to "normal" views)
>> call view.url() in your template.
>
> Yes, I think it's very attractive for that reason.
>
>> This would 1) result in less code to maintain, 2) opening up the
>> possibility to create at some point in time a viewlet.url() that
>> constructs the URL to the individual viewlet.
>
> Right. We just need to be crystal-clear in documentation that our
> viewlets are different from Zope 3's regular viewlets in this regard.
> Normally, the rule in Zope 3 is this: if you have a class and an
> associated template, the class's instance is available in the template
> namespace under 'view', no matter what it really is. I realize that the
> idea proposed above is more attractive and I support it, we just need to
> be careful to document it well.
I think it is safe to say we reached a consensus on this issue. I'll
summarize it in the issue in launchpad and then I'll be working on it.
Thanks for all the constructive feedback.
regards,
jw
More information about the Grok-dev
mailing list