[Grok-dev] ClassGrokkers and component_class and component base classes

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Feb 6 11:03:15 EST 2007


Hi,


grok.meta.ViewGrokker looks out for classes that subclass grok.View.
However, the grok.View class itself "subclasses" grok.View as well
(according to issubclass()) and thus grok.View is actually grokked
(and some view is registered, but for what?).

The fact that grok component base classes are grokked as well hit me
when I tried to implement my own grokker for my own type of component:

component.py:

  class MyComponent(object):
    pass

meta.py:

  MyComponentGrokker(grok.ClassGrokker):
    component_class = MyComponent

    def register(self, context, name, factory, module_info, templates):
      ...

where the MyComponent class itself is just a base class for the actual
component implementations in my application.

(I wonder if I still make sense...)

Can we somehow prevent the component base classes from being grokked?


kind regards,
jw

-- 
Jan-Wijbrand Kolman


More information about the Grok-dev mailing list