[Grok-dev] Re: Using martian to load schemata

Leonardo Rochael Almeida leorochael at gmail.com
Wed Jun 25 12:19:27 EDT 2008


What I think might not work in your example is that there are things
that happen at "import time" which you really can't work around, for
instance, if I have a grok.Form with grok.AutoFields(IPage) interface,
either "model('page.xml') will have to work immediately (which means
not being able to rely on the C.A. being set up), or the AutoFields
call won't find any actual fields on your interface.

On Wed, Jun 25, 2008 at 13:02, Martin Aspeli <optilude at gmx.net> wrote:
> Martin Aspeli <optilude <at> gmx.net> writes:
>
>> Can anyone tell me whether Martian would be worth exploring here? Or do I
>> need something else that's more aware of the Zope 3 CA? I don't fully
>> understand how to react once the CA is loaded, though I'm guessing I should
>> be using zope.configuration actions in some way and ensure that my actions
>> execute late in the process?
>
> I've been digging around martian and grokcore.component. I see how
> grokcore.component uses configuration actions via a 'config' variable. I
> *think* I could do something similar, e.g.
>
> class IPage(Schema):
>    model("page.xml")
>
> where Schema would be a grokkable base class and model would be a martian
> directive.
>
> What I haven't quite understood, is where the 'config' parameter in e.g. the
> AdapterGrokker's execute() method comes from. I guess it has something to do
> with directive.bind(), but I got a bit lost in the code at that point.
>
> I'm also not quite sure how to use config.action() to ensure that my
> particular callable gets executed after all standard components have been set
> up, though I guess that's a zope.configuration question?
>
> Any hints?
>
> Cheers,
> Martin
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev
>


More information about the Grok-dev mailing list