Phillip J. Eby writes:
 > At 10:01 PM 5/17/00 +0100, Steve Alexander wrote:
 > >
 > >The _defaultClass only needs to become DemoPortal.LoginMember before a
 > >Portal's LoginManager instance is created.
 > >
 > >Therefore, you can leave the _defaultClass as LoginUser until the
 > >"install" method of DemoPortalBase is called (PTKDemo/
 > >
 > >In the "install" method, after creating a MembersClass(), set its
 > >_defaultClass to LoginMember.
 > It would be better to call manage_setStorage(zclass='meta type') rather
 > than tinkering with attributes directly, as manage_setStorage should always
 > be forward-compatible.

Ah yes, forgot about this problem -- it was yesterday...

Here's my current code from DemoPortalBase.install:

        elif db == 'LoginManager':
            from Products.LoginManager.LoginManager import \
                 LoginManager, manage_addLoginManager
            from PersistentUserSource import PersistentUserSource
            self.MembersClass = LoginManager # maybe not needed anymore
                                   'Persistent User Source',
                                   ['Basic Auth Login'],
                                   0, 0, 0)
            for us in self.acl_users.UserSourcesGroup.objectValues():
                if us.meta_type == 'Persistent User Source':
The commented out line fails because it doesn't have a
manage_setStorage.  The uncommented out code causes the following
traceback.  It was after I hit this that I started hacking on
_defaultClass...  Probably I should have yelled for help then, but I
have this bad habit of digging myself in as far a possible first :-)

Traceback (innermost last):
  File /home/zope/lib/python/ZPublisher/, line 214, in publish_module
  File /home/zope/lib/python/ZPublisher/, line 179, in publish
  File /home/zope/lib/python/Zope/, line 202, in zpublisher_exception_hook
  File /home/zope/lib/python/ZPublisher/, line 165, in publish
  File /home/zope/lib/python/ZPublisher/, line 160, in mapply
    (Object: Portal_add)
  File /home/zope/lib/python/ZPublisher/, line 102, in call_object
    (Object: Portal_add)
  File /home/zope/lib/python/OFS/, line 150, in __call__
    (Object: Portal_add)
  File /home/zope/lib/python/DocumentTemplate/, line 502, in __call__
    (Object: Portal_add)
  File /home/zope/lib/python/DocumentTemplate/, line 148, in render
    (Object: Portal.createInObjectManager(REQUEST['id'], REQUEST))
  File /home/zope/lib/python/Products/PTKDemo/, line 71, in install
    (Object: DemoPortalBase)
  File /home/dan/src/Zope-2.1.6-src/lib/python/Products/ZPatterns/, line 348, 
in manage_setStorage
    (Object: AttributeProviderContainer)
  File /home/dan/src/Zope-2.1.6-src/lib/python/Products/ZPatterns/, line 225, 
in _unifiedZClassRegistry
    (Object: AttributeProviderContainer)
AttributeError: (see above)

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to