Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

CMFUid

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


charlie at begeistert

Feb 8, 2008, 7:41 AM

Post #1 of 1 (895 views)
Permalink
CMFUid

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.