[Zope3-Users] Autocreated content objects

John Maddison maddisjohn at gmail.com
Tue Sep 26 21:13:37 EDT 2006


Oops, forgot to CC the list.

On 9/27/06, John Maddison <maddisjohn at gmail.com> wrote:
> On 9/26/06, Fred Drake <fdrake at gmail.com> wrote:
> > On 9/26/06, John Maddison <maddisjohn at gmail.com> wrote:
> > > Right, that's basically what I want to run, but I can't seem to figure
> > > out how to have that run at ZODB creation time.  Should I be listening
> > > for the event that Fred added (thanks!) and run that in the
> > > subscriber?
> >
> > There are a couple of ways to go about this with the current codebase:
> >
> > 1) Listen for the IDatabaseOpenedEvent, and make sure you get there
> > before the default subscriber does.  Add your root before the default
> > root is created.
> >
> > 2) Listen for the IDatabaseOpenedWithRootEvent, and be willing to
> > replace the application root.  You need to be sure that you're
> > replacing it with an object that will support all the things you
> > expect, since the default is an actual ISite implementation.  (Not
> > sure just how important that really is, though.  Lots of code will
> > expect it to be, but hopefully nothing really fundamental.)
>
> Ah, I think I may have misdescribed what I was trying to do - I'm not
> trying to replace the root object, I'm trying to automatically create
> some other objects to put inside it (without having to use the ZMI).


More information about the Zope3-users mailing list