[Grok-dev] Re: zope.app.keyreference.interfaces.NotYet(object)
Sebastian Ware
sebastian at urbantalk.se
Mon Jul 16 03:27:57 EDT 2007
So the behaviour of grok.Application is different from that of
grok.Container with respect to when the catalog(?) that holds the
content is created.
This is a bit confusing to me, even though I am sure there is a
technical explanation I would have preferred that they worked in the
same way.
Mvh Sebastian
15 jul 2007 kl. 22.59 skrev Philipp von Weitershausen:
> Sebastian Ware wrote:
>> What surprised me was that that kind of assignment worked with my
>> grok.Application object...
>> class ProtonCMS(grok.Application, grok.Container):
>> interface.implements(interfaces.IProtonCMS)
>> def __init__(self):
>> super(ProtonCMS, self).__init__()
>> self.title = ''
>> self.description = ''
>> self['default'] = protonworkflow.ProtonWorkflow()
>> ...and I was expecting the "class ProtonContainer(grok.Container,
>> protonobject.ProtonObject)" to work in the same way.
>> Do you know why I can make the assignment in the grok.Application
>> object but not in the grok.Container object?
>
> Yup. Because the catalog (which keeps the indexes for your objects)
> is created whenever a grok.Application object is created. Actually,
> it's creates slightly after the application object. That's why
> indexing won't happen in any application's __init__ method. But it
> will happen upon all other modified events, and container[name] =
> obj happens to throw a ContainerModifiedEvent or something of that
> sort.
>
> --
> http://worldcookery.com -- Professional Zope documentation and
> training
More information about the Grok-dev
mailing list