Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  subclasses did not implement IBrowserView.
  • Loading branch information
philikon committed Dec 3, 2007
1 parent e6f3435 commit c2f73ec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Grok changes
0.10.3
======

* ...
Bug fixes
---------

* Fix https://bugs.launchpad.net/grok/+bug/162437: grok.Form and its
subclasses did not implement IBrowserView.

0.10.2 (2007-10-24)
===================
Expand Down
4 changes: 2 additions & 2 deletions src/grok/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

class IGrokBaseClasses(interface.Interface):
Expand Down Expand Up @@ -237,7 +237,7 @@ def action(label, actions=None, **options):
"""


class IGrokView(IBrowserPage):
class IGrokView(IBrowserPage, IBrowserView):
"""Grok views all provide this interface."""

context = interface.Attribute('context', "Object that the view presents.")
Expand Down
11 changes: 10 additions & 1 deletion src/grok/tests/form/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
...
AttributeError: 'Cave' object has no attribute 'ignored'
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
Expand All @@ -34,6 +34,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(
Expand Down

0 comments on commit c2f73ec

Please sign in to comment.