[Grok-dev] Viewlets: Check for availability

Christian Klinger cklinger at novareto.de
Wed Jun 15 02:08:56 EDT 2011


Hi,

i think there were some discussions lately about this topic on a sprint.
I don't know to which conclusions we come...

For me i want to add a +1 for it.

Christian

> Hi, guys.
>
> I was wondering why viewlets in Grok, like viewlets in Plone, don't have
> a method to check their availability at the render time.
> This would be as simple as changing the last line in the render method
> of the ViewletManager component (grokcore.viewlet:components.py):
>
> class ViewletManager(ViewletManagerBase):
> ...
> def render(self):
> ....
> -- return u'\n'.join([viewlet.render() for viewlet in self.viewlets])
> ++ return u'\n'.join([viewlet.render() for viewlet in self.viewlets i f
> viewlet.available()])
>
> and adding the available method to Viewlet:
>
> class Viewlet(ViewletBase):
> ...
>
> def available(self):
> return True
>
>
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev




More information about the Grok-dev mailing list