[CMF-checkins] CVS: Products/CMFCore - PortalContent.py:1.47.2.1
Jens Vagelpohl
jens at dataflake.org
Thu May 5 16:54:02 EDT 2005
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv23261/CMFCore
Modified Files:
Tag: CMF-1_5-branch
PortalContent.py
Log Message:
- CMFTopic.Topic/CMFCore.PortalContent: Both these classes were using
the now-deprecated CMFCore.utils._getViewFor method, and strangely
enough the deprecation warning didn't show. Replaced with the
new method of getting the view.
=== Products/CMFCore/PortalContent.py 1.47 => 1.47.2.1 ===
--- Products/CMFCore/PortalContent.py:1.47 Thu Aug 12 11:07:39 2004
+++ Products/CMFCore/PortalContent.py Thu May 5 16:53:32 2005
@@ -76,8 +76,7 @@
security.declareProtected(FTPAccess, 'manage_FTPlist')
def failIfLocked(self):
- """
- Check if isLocked via webDav
+ """ Check if isLocked via webDav
"""
if self.wl_isLocked():
raise ResourceLockedError('This resource is locked via webDAV.')
@@ -95,22 +94,22 @@
return "%s %s" % (self.Title(), self.Description())
def __call__(self):
- '''
- Invokes the default view.
- '''
- view = _getViewFor(self)
- if getattr(aq_base(view), 'isDocTemp', 0):
- return view(self, self.REQUEST)
+ """ Invokes the default view.
+ """
+ view_id = self.getTypeInfo().queryMethodID('view')
+ view_obj = self.unrestrictedTraverse(view_id)
+
+ if getattr(aq_base(view_obj), 'isDocTemp', 0):
+ return view_obj(self, self.REQUEST)
else:
- return view()
+ return view_obj()
index_html = None # This special value informs ZPublisher to use __call__
security.declareProtected(View, 'view')
def view(self):
- '''
- Returns the default view even if index_html is overridden.
- '''
+ """ Returns the default view even if index_html is overridden.
+ """
return self()
InitializeClass(PortalContent)
More information about the CMF-checkins
mailing list