[Checkins] SVN: zope.publisher/trunk/src/zope/publisher/interfaces/ Bring back the IView contract and make IBrowserView inherit it. The IView can be used for non-browser views, like IFTPView. The IView is now placed in zope.publisher.interfaces.

Dan Korostelev nadako at gmail.com
Sun Mar 8 03:54:30 EDT 2009


Log message for revision 97646:
  Bring back the IView contract and make IBrowserView inherit it. The IView can be used for non-browser views, like IFTPView. The IView is now placed in zope.publisher.interfaces.

Changed:
  U   zope.publisher/trunk/src/zope/publisher/interfaces/__init__.py
  U   zope.publisher/trunk/src/zope/publisher/interfaces/browser.py

-=-
Modified: zope.publisher/trunk/src/zope/publisher/interfaces/__init__.py
===================================================================
--- zope.publisher/trunk/src/zope/publisher/interfaces/__init__.py	2009-03-08 06:45:25 UTC (rev 97645)
+++ zope.publisher/trunk/src/zope/publisher/interfaces/__init__.py	2009-03-08 07:54:30 UTC (rev 97646)
@@ -456,3 +456,9 @@
 class IRequest(IPublisherRequest, IPublicationRequest, IApplicationRequest):
     """The basic request contract
     """
+
+class IView(Interface):
+    """Generic view contract"""
+
+    request = Attribute("The request object that requested the view")
+    context = Attribute("The context object that the view is for")

Modified: zope.publisher/trunk/src/zope/publisher/interfaces/browser.py
===================================================================
--- zope.publisher/trunk/src/zope/publisher/interfaces/browser.py	2009-03-08 06:45:25 UTC (rev 97645)
+++ zope.publisher/trunk/src/zope/publisher/interfaces/browser.py	2009-03-08 07:54:30 UTC (rev 97646)
@@ -23,6 +23,7 @@
 
 from zope.publisher.interfaces import IPublication
 from zope.publisher.interfaces import IPublishTraverse
+from zope.publisher.interfaces import IView
 from zope.publisher.interfaces.http import IHTTPApplicationRequest
 from zope.publisher.interfaces.http import IHTTPRequest
 
@@ -127,13 +128,10 @@
         the base href.
         """
 
-class IBrowserView(Interface):
+class IBrowserView(IView):
     """Browser View"""
 
-    request = Attribute("The request object that requested the view")
-    context = Attribute("The context object that the view is for")
 
-
 class IBrowserPage(IBrowserView, IBrowserPublisher):
     """Browser page"""
 



More information about the Checkins mailing list