[Zope3-Users] make a Folder a Site

Ivo van der Wijk vladdrac at gmail.com
Thu May 26 06:02:50 EDT 2005


On 5/25/05, Jan-Wijbrand Kolman <jw at infrae.com> wrote:
> Hello,
> 
> 
(..)
> Now I want this FooFolder to become a site right after having added it (so,
> instead of doing this from the ZMI). I naively thought to do this in the
> FooFolder's __init__, like so:
> 

What I currently do is:

Derive from Folder and SiteManagerContainer, and in the __init__ do
the following:

        self.setSiteManager(LocalSiteManager(self))
        ## required for getUtility to work within this request
        setSite(self)

(actually I'm doing this from an event handler, but it should just
work from __init__ afaik)

Cheers

  Ivo

-- 
Drs. I.R. van der Wijk                                      -=-
Korte Leidsedwarsstraat 12                                 Amaze
1017 RC Amsterdam, NL                                       -=-
T +31-20-4688336         F +31-20-4688337       Zope/Plone/Content Management
W http://www.amaze.nl    E info at amaze.nl           Open Source Solutions
W http://vanderwijk.info E ivo at amaze.nl                 Consultancy
PGP http://vanderwijk.info/pgp


More information about the Zope3-users mailing list