[Grok-dev] Re: How does the grokkers actually work in grok?

Philipp von Weitershausen philipp at weitershausen.de
Fri Oct 5 05:10:56 EDT 2007


Fernando Correa Neto wrote:
> Hello everyone,
> 
> I've been playing with a extension for grok that will allow the use of
> Buffet (megrok.buffet acutally).
> I've read all the documentation about martian and I understand how the
> grokkers works, the problem is when it comes to my extension.
> So far I have something similiar to this:
> 
> megrok/buffet/
> 
> components.py:
> 
> class View(grok.View):
>     """code that renders the view"""
> 
> 
> grokker.py:
> 
> class BuffetViewGrokker(martian.ClassGrokker):
>     class_component = View
> 
>     def grok(...):
>         """setup code"""
> 
>     def register(...):
>         """It must be here"""
> 
> 
> With this I can perfectly subclass from megrok.buffet.View but the
> problem is that I need to setup some code for that.
> How does or how do I know that grok instanciate the BuffetViewGrokker?
> I suspect it is not been grokked.

You need to make sure your grokker is grokked :).

<grok:grok package=".grokker" />


-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Grok-dev mailing list