[Checkins] SVN: grok/trunk/ Forward-port bugfix from the 0.10 branch:

Philipp von Weitershausen philikon at philikon.de
Mon Dec 3 10:44:57 EST 2007


Log message for revision 82100:
  Forward-port bugfix from the 0.10 branch:
   
  ------------------------------------------------------------------------
  r82097 | philikon | 2007-12-03 16:36:35 +0100 (Mon, 03 Dec 2007) | 4 lines
  
  * Fix https://bugs.launchpad.net/grok/+bug/162437: grok.Form and its
    subclasses did not implement IBrowserView.
  

Changed:
  U   grok/trunk/CHANGES.txt
  U   grok/trunk/src/grok/interfaces.py
  U   grok/trunk/src/grok/tests/form/form.py

-=-
Modified: grok/trunk/CHANGES.txt
===================================================================
--- grok/trunk/CHANGES.txt	2007-12-03 15:43:42 UTC (rev 82099)
+++ grok/trunk/CHANGES.txt	2007-12-03 15:44:56 UTC (rev 82100)
@@ -26,6 +26,9 @@
   doctest. This needed a bugfix in Martian (since 0.9.2). Add a test
   that demonstrates this problem.
 
+* Fix https://bugs.launchpad.net/grok/+bug/162437: grok.Form and its
+  subclasses did not implement IBrowserView.
+
 0.11 (2007-11-08)
 =================
 

Modified: grok/trunk/src/grok/interfaces.py
===================================================================
--- grok/trunk/src/grok/interfaces.py	2007-12-03 15:43:42 UTC (rev 82099)
+++ grok/trunk/src/grok/interfaces.py	2007-12-03 15:44:56 UTC (rev 82100)
@@ -14,7 +14,7 @@
 """Grok interfaces
 """
 from zope import interface, schema
-from zope.publisher.interfaces.browser import IBrowserPage
+from zope.publisher.interfaces.browser import IBrowserPage, IBrowserView
 from zope.formlib.interfaces import reConstraint
 from zope.interface.interfaces import IInterface
 
@@ -255,7 +255,7 @@
 
     IRESTSkinType = interface.Attribute('The REST skin type')
 
-class IGrokView(IBrowserPage):
+class IGrokView(IBrowserPage, IBrowserView):
     """Grok views all provide this interface."""
 
     context = interface.Attribute('context', "Object that the view presents.")

Modified: grok/trunk/src/grok/tests/form/form.py
===================================================================
--- grok/trunk/src/grok/tests/form/form.py	2007-12-03 15:43:42 UTC (rev 82099)
+++ grok/trunk/src/grok/tests/form/form.py	2007-12-03 15:44:56 UTC (rev 82100)
@@ -1,5 +1,5 @@
 """
-A grok.EditForm is a special grok.View that renders an edit form.
+A grok.EditForm is a special view that renders an edit form.
 
   >>> from zope import component
   >>> from zope.publisher.browser import TestRequest
@@ -13,6 +13,15 @@
   >>> [w.__name__ for w in view.form_fields]
   ['name', 'size']
 
+Let's assert that forms are indeed Zope 3-style browser views and
+browser pages:
+
+  >>> from zope.publisher.interfaces.browser import IBrowserPage, IBrowserView
+  >>> IBrowserPage.providedBy(view)
+  True
+  >>> IBrowserView.providedBy(view)
+  True
+
 It is important to keep the order of the fields:
 
   >>> view = component.getMultiAdapter(



More information about the Checkins mailing list