[Zope3-Users] make a Folder a Site

Jan-Wijbrand Kolman jw at infrae.com
Wed May 25 06:09:33 EDT 2005


Hello,


Maybe I miss something very obvious here...

I created a FooFolder class, subclassing zope.app.folder.Folder. After adding
the necessary configurations, I have an entry in the addMenu, and I indeed can
add a FooFolder instance.

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:

  from zope.app.folder import Folder
  from zope.app.site.service import SiteManager

  class FooFolder(Folder):

    def __init__(self):
      super(FooFolder, self).__init__()
      sitemanager = SiteManager(self)
      self.setSiteManager(sitemanager)

This however throws:

  File "/home/jw/projects/zope3x/lib/python/zope/app/site/service.py", line 81,
in __init__
    self._setNext(site)
  File "/home/jw/projects/zope3x/lib/python/zope/app/site/service.py", line 96,
in _setNext
    raise TypeError("Not enough context information")


Somehow I cannot think of the correct way to do this... Can anyone help? Do I
need to specify more details?


TIA, regards,
jw

-- 
Jan-Wijbrand Kolman
jw at infrae.com


More information about the Zope3-users mailing list