[CMF-checkins] SVN: CMF/trunk/C Ouch! CMFCore/dtml/catalogFind.dtml
still depends on by_metatype=1
Yvo Schubbe
y.2005- at wcm-solutions.de
Sun Sep 11 14:34:59 EDT 2005
Log message for revision 38441:
Ouch! CMFCore/dtml/catalogFind.dtml still depends on by_metatype=1
Can't see an easy way to fix that, so I reverted r37858 - at least for now - and documented the issue in the docstring.
Changed:
U CMF/trunk/CHANGES.txt
U CMF/trunk/CMFCore/TypesTool.py
U CMF/trunk/CMFCore/interfaces/portal_types.py
-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt 2005-09-10 17:43:24 UTC (rev 38440)
+++ CMF/trunk/CHANGES.txt 2005-09-11 18:34:58 UTC (rev 38441)
@@ -76,8 +76,6 @@
Others
- - TypesTool: Removed deprecated by_metatype argument of listContentTypes.
-
- Some simplifications to the slurp_release release helper script and
updates to the RELEASE.txt release instructions.
Modified: CMF/trunk/CMFCore/TypesTool.py
===================================================================
--- CMF/trunk/CMFCore/TypesTool.py 2005-09-10 17:43:24 UTC (rev 38440)
+++ CMF/trunk/CMFCore/TypesTool.py 2005-09-11 18:34:58 UTC (rev 38441)
@@ -839,12 +839,24 @@
return rval
security.declareProtected(AccessContentsInformation, 'listContentTypes')
- def listContentTypes(self, container=None):
+ def listContentTypes(self, container=None, by_metatype=0):
""" List type info IDs.
+
+ Passing 'by_metatype' is deprecated (type information may not
+ correspond 1:1 to an underlying meta_type). This argument will be
+ removed when CMFCore/dtml/catalogFind.dtml doesn't need it anymore.
"""
typenames = {}
for t in self.listTypeInfo( container ):
- name = t.getId()
+
+ if by_metatype:
+ warn('TypeInformation.listContentTypes(by_metatype=1) is '
+ 'deprecated.',
+ DeprecationWarning)
+ name = t.Metatype()
+ else:
+ name = t.getId()
+
if name:
typenames[ name ] = None
Modified: CMF/trunk/CMFCore/interfaces/portal_types.py
===================================================================
--- CMF/trunk/CMFCore/interfaces/portal_types.py 2005-09-10 17:43:24 UTC (rev 38440)
+++ CMF/trunk/CMFCore/interfaces/portal_types.py 2005-09-11 18:34:58 UTC (rev 38441)
@@ -128,11 +128,15 @@
the user's permissions.
"""
- def listContentTypes(container=None):
+ def listContentTypes(container=None, by_metatype=0):
""" List type info IDs.
If 'container' is passed, then filter the list to include only types
which are addable in 'container'.
+
+ Passing 'by_metatype' is deprecated (type information may not
+ correspond 1:1 to an underlying meta_type). This argument will be
+ removed when CMFCore/dtml/catalogFind.dtml doesn't need it anymore.
"""
def constructContent(contentType, container, id, RESPONSE=None
More information about the CMF-checkins
mailing list