[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-cmf
Subject:    [Zope-CMF] CMFUid
From:       Charlie Clark <charlie () begeistert ! org>
Date:       2008-02-08 15:41:02
Message-ID: 6FBD41E8-7FC4-46DB-B298-89B4D7D8D6C6 () begeistert ! org
[Download RAW message or body]

Dear all,

I'm looking at using CMFUid and I'm not quite sure how to use it: do I  
need to add support for it explicitly in my objects, ie.

from Products.CMFCore.PortalContent import PortalContent

from Products.CMFCore.utils import getUtilityByInterfaceName
from AccessControl import ClassSecurityInfo

class AContentObject(PortalContent):
     security = ClassSecurityInfo()

     def __init__(self, title=None, description=None):
         uid = getUtilityByInterfaceName('portal_uidgenerator')
	self.id = uid()

Or is this a case for using an adapter?

from Products.CMFUid.interfaces import IUniqueIdAnnotation?

class AContentObject(PortalContent):
     security = ClassSecurityInfo()

     def __init__(self, title=None, description=None):
         self.id = IUniqueIdAnnotation(self)

which allows behaviour to be configured site wide?

Charlie
-
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic