[Zope-CMF] what happened to Document???

marc lindahl marc@bowery.com
Thu, 31 May 2001 22:01:45 -0400


> From: Shane Hathaway <shane@digicool.com>
> 
> This happened because Document now has a __call__() method.  It didn't
> before.

Well, poking around my site, there's other stuff that's breaking because of
this (and, not just my own code!)

I'm temporarily rebelling....  I took a look at the diffs to put the call in
there, and HACKed PortalContent.py to get the old behavior back.  Here's my
diff... seems to work :)




*** loptop:BOWERY.COM:zope:CVS:CMF:CMFCore:PortalContent.py    Thu May 31
17:48:30 2001
--- loptop:BOWERY.COM:zope:CVS:PortalContent.py    Thu May 31 21:59:31 2001
***************
*** 202,225 ****
              raise 'Not Found', ('Cannot find default view for "%s"' %
                                  string.join(self.getPhysicalPath(), '/'))
  
!     def __call__(self):
!         '''
!         Invokes the default view.
!         '''
!         view = self._getDefaultView()
!         if getattr(aq_base(view), 'isDocTemp', 0):
!             return apply(view, (self, self.REQUEST))
!         else:
!             return view()
  
-     index_html = None  # This special value informs ZPublisher to use
__call__
- 
      security.declareProtected(CMFCorePermissions.View, 'view')
!     def view(self):
!         '''
!         Returns the default view even if index_html is overridden.
!         '''
!         return self()
  
      # Overridden methods to support cataloging items that might
      # be stored in attributes unknown to the content object, such
--- 202,214 ----
              raise 'Not Found', ('Cannot find default view for "%s"' %
                                  string.join(self.getPhysicalPath(), '/'))
  
!     _index_html = _getDefaultView
!     security.declareProtected(CMFCorePermissions.View, 'index_html')
!     index_html = _getDefaultView
  
      security.declareProtected(CMFCorePermissions.View, 'view')
!     view = index_html  # Necessary for catalog searches.
! 
  
      # Overridden methods to support cataloging items that might
      # be stored in attributes unknown to the content object, such