[CMF-checkins] CVS: Products/CMFCore - PortalContent.py:1.47.2.2

Jens Vagelpohl jens at dataflake.org
Mon May 9 16:18:45 EDT 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv15154/CMFCore

Modified Files:
      Tag: CMF-1_5-branch
	PortalContent.py 
Log Message:
- CMFTopic.Topic/CMFCore.PortalContent: Clean up a previous change
  by changing __call__ methods to be aligned with what's on CVS
  HEAD and using the old _getViewFor function as a fallback to
  retain backwards compatibility.


=== Products/CMFCore/PortalContent.py 1.47.2.1 => 1.47.2.2 ===
--- Products/CMFCore/PortalContent.py:1.47.2.1	Thu May  5 16:53:32 2005
+++ Products/CMFCore/PortalContent.py	Mon May  9 16:18:15 2005
@@ -96,13 +96,17 @@
     def __call__(self):
         """ Invokes the default view.
         """
-        view_id = self.getTypeInfo().queryMethodID('view')
-        view_obj = self.unrestrictedTraverse(view_id)
+        ti = self.getTypeInfo()
+        method_id = ti and ti.queryMethodID('(Default)')
+        if method_id:
+            method = getattr(self, method_id)
+        else:
+            method = _getViewFor(self)
 
-        if getattr(aq_base(view_obj), 'isDocTemp', 0):
-            return view_obj(self, self.REQUEST)
+        if getattr(aq_base(method), 'isDocTemp', 0):
+            return method(self, self.REQUEST)
         else:
-            return view_obj()
+            return method()
 
     index_html = None  # This special value informs ZPublisher to use __call__
 



More information about the CMF-checkins mailing list