Michael Howitz wrote:
Am Dienstag, den 07.03.2006, 09:06 -0700 schrieb Jeff Shell:
On 3/6/06, Florian Lindner <[EMAIL PROTECTED]> wrote:
[...]
    # Get the default registration
    default = context.getSiteManager()['default']
    reg_manager = default.registrationManager

    if 'intid' not in default:
        # There's a shorter way to do this, but I can never remember what it is
        intid = IntIds()
        default['intid'] = intid
        intids_reg = UtilityRegistration('', IIntIds, intid)
        reg_manager.addRegistration(intids_reg)
        intids_reg.status = ActiveStatus

The shorter way is:
zope.app.appsetup.bootstrap.ensureUtility(
                       context, IIntIds, '', IntIds, copy_to_zlog=False)



nice :-)

The event driven initialization is probably the best way to go. I tried the same with tiks.initializer (from http://svn.tiks.org/svn/repos/tiks.initializer/trunk) under zope3.1. I had problems to get it to work, so I switched to the view based initialization. Have to retry it though.

- Andreas

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to