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

Reply via email to