[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form -
schemadisplay.py:1.14 editwizard.py:1.20 editview.py:1.47
Dominik Huber
dominik.huber at projekt01.ch
Wed Feb 25 08:21:50 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv13752
Modified Files:
schemadisplay.py editwizard.py editview.py
Log Message:
BUG FIX: The form framework supports now security-proxied adapters
(adapter invoked via __conform__). '_setUpWidget' method of EditView,
EditWizardView and DisplayView provides a LocationProxy
for all adapters which do not implement ILocation itself.
Involved files:
zope\app\browser\form\editview.py
zope\app\browser\form\editwizard.py
zope\app\browser\form\schemadisplay.py
zope\app\browser\form\tests\test_editview.py:
- add test_update_via_adapter
- add test_setUpWidget_via_conform_adapter
=== Zope3/src/zope/app/browser/form/schemadisplay.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/browser/form/schemadisplay.py:1.13 Tue Dec 16 15:31:27 2003
+++ Zope3/src/zope/app/browser/form/schemadisplay.py Wed Feb 25 08:21:50 2004
@@ -49,6 +49,8 @@
def _setUpWidgets(self):
adapted = getAdapter(self.context, self.schema)
if adapted is not self.context:
+ if not ILocation.isImplementedBy(adapted):
+ adapted = LocationProxy(adapted)
adapted.__parent__ = self.context
self.adapted = adapted
setUpDisplayWidgets(self, self.schema, names=self.fieldNames,
=== Zope3/src/zope/app/browser/form/editwizard.py 1.19 => 1.20 ===
--- Zope3/src/zope/app/browser/form/editwizard.py:1.19 Fri Feb 6 01:24:44 2004
+++ Zope3/src/zope/app/browser/form/editwizard.py Wed Feb 25 08:21:50 2004
@@ -59,6 +59,8 @@
def _setUpWidgets(self):
adapted = getAdapter(self.context, self.schema)
if adapted is not self.context:
+ if not ILocation.isImplementedBy(adapted):
+ adapted = LocationProxy(adapted)
adapted.__parent__ = self.context
self.adapted = adapted
=== Zope3/src/zope/app/browser/form/editview.py 1.46 => 1.47 ===
--- Zope3/src/zope/app/browser/form/editview.py:1.46 Thu Feb 5 17:52:19 2004
+++ Zope3/src/zope/app/browser/form/editview.py Wed Feb 25 08:21:50 2004
@@ -26,6 +26,8 @@
from zope.app.i18n import ZopeMessageIDFactory as _
from zope.app.interfaces.form import WidgetsError
+from zope.app.location import LocationProxy
+from zope.app.interfaces.location import ILocation
from zope.app.form.utility import setUpEditWidgets, applyWidgetsChanges
from zope.app.browser.form.submit import Update
from zope.app.event import publish
@@ -58,6 +60,8 @@
def _setUpWidgets(self):
adapted = getAdapter(self.context, self.schema)
if adapted is not self.context:
+ if not ILocation.isImplementedBy(adapted):
+ adapted = LocationProxy(adapted)
adapted.__parent__ = self.context
self.adapted = adapted
setUpEditWidgets(self, self.schema, names=self.fieldNames,
More information about the Zope3-Checkins
mailing list