[Grok-dev] Spotlight on : dolmen.content
Souheil CHELFOUH
trollfot at gmail.com
Fri Jan 22 03:04:22 EST 2010
Hello Aroldo !
Actually, there's nothing really magic here,
the "grok_component" function takes care of "grokking" your component.
Usually, this is done at startup time, with the rest of your packages.
Here, we do it manually, because it's a demonstration and a test.
grok_component calls the "grokker" that takes care of your component.
To do so, you have to give it a name and the component to Grok.
Here, "mycontent" is just an arbitrary name that has no importance.
MyContent is the class we want "grokked".
2010/1/22 Aroldo Souza-Leite <asouzaleite at gmx.de>:
> Hi Souheil,
>
> I didn't undertand where the class MyComponent was grokked into the registry
> under the component name "mycomponent" so that
>
> >>> from grokcore.component import testing
> >>> testing.grok_component('mycontent', MyContent)
> True
>
>
> became true. Is there an obvious, explicit Grok directive you didn't show in
> the code or did some automagic Grok directive do it and chose the default
> name "mycomponent" for it?
>
>
> Thanks for the article.
>
> Regards,
>
> Aroldo.
>
>
>
>
>
>
More information about the Grok-dev
mailing list