[Zope-CMF] CMFUid
Charlie Clark
charlie at begeistert.org
Fri Feb 8 10:41:02 EST 2008
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
More information about the Zope-CMF
mailing list