[CMF-checkins] CVS: CMF/CMFDefault - MetadataTool.py:1.15
Shane Hathaway
shane@cvs.zope.org
Thu, 20 Jun 2002 15:53:25 -0400
Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv17401
Modified Files:
MetadataTool.py
Log Message:
Since elements and policies are now SimpleItems, they must always be
wrapped. Otherwise the name REQUEST resolves to the special value
"Acquisition.Acquired" and DTML leaves the realm of sanity. ;-)
Arranged for wrapping at the appropriate times and updated unit tests
accordingly.
=== CMF/CMFDefault/MetadataTool.py 1.14 => 1.15 ===
"""
try:
- return self.policies[ typ ]
+ return self.policies[ typ ].__of__(self)
except KeyError:
return self.policies[ None ]
@@ -159,7 +159,10 @@
"""
Return a list of all policies for this element.
"""
- return self.policies.items()
+ res = []
+ for k, v in self.policies.items():
+ res.append((k, v.__of__(self)))
+ return res
security.declareProtected( CMFCorePermissions.ManagePortal , 'addPolicy' )
def addPolicy( self, typ ):
@@ -387,7 +390,10 @@
Return a list of ElementSpecs representing
the elements managed by the tool.
"""
- return tuple( self.element_specs.items() )
+ res = []
+ for k, v in self.element_specs.items():
+ res.append((k, v.__of__(self)))
+ return res
security.declareProtected( CMFCorePermissions.ManagePortal
, 'getElementSpec' )