[Zope3-checkins] CVS: Zope3/src/zope/app/browser/utilities -
schema.py:1.4 traversal.py:1.4
Jim Fulton
jim at zope.com
Sun Sep 21 13:31:42 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/utilities
In directory cvs.zope.org:/tmp/cvs-serv12774/src/zope/app/browser/utilities
Modified Files:
schema.py traversal.py
Log Message:
No-longer use context wrappers.
=== Zope3/src/zope/app/browser/utilities/schema.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/utilities/schema.py:1.3 Sun Aug 17 02:06:01 2003
+++ Zope3/src/zope/app/browser/utilities/schema.py Sun Sep 21 13:31:11 2003
@@ -37,9 +37,9 @@
return getFieldNamesInOrder(self.context)
def fields(self):
- return [{'name':name,
- 'field':zapi.ContextWrapper(field, self.context),
- 'type':field.__class__.__name__}
+ return [{'name': name,
+ 'field': field,
+ 'type': field.__class__.__name__}
for name, field in getFieldsInOrder(self.context)]
def update(self):
@@ -67,7 +67,6 @@
def _setUpWidgets(self):
adapted = zapi.getAdapter(self.context, self.schema)
if adapted is not self.context:
- adapted = zapi.ContextWrapper(adapted, self.context,
- name=_('(adapted)'))
+ adapted.__parent__ = self.context
setUpEditWidgets(self, self.schema, names=self.fieldNames,
content=self.adapted)
=== Zope3/src/zope/app/browser/utilities/traversal.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/utilities/traversal.py:1.3 Sun Aug 17 02:06:01 2003
+++ Zope3/src/zope/app/browser/utilities/traversal.py Sun Sep 21 13:31:11 2003
@@ -21,10 +21,10 @@
from zope.exceptions import NotFoundError
from zope.proxy import removeAllProxies
-from zope.app.context import ContextWrapper
from zope.app.interfaces.traversing import ITraversable
from zope.app.traversing.namespace import UnexpectedParameters
+from zope.app.interfaces.location import ILocation
_marker = object()
@@ -41,16 +41,21 @@
subob = self.context.get(name, None)
# XXX: Check that subobj has self.context as parent!
+ # YYY: Why?
+
if subob is None:
view = queryView(self.context, name, request)
if view is not None:
+ if ILocation.isImplementedBy(view):
+ view.__parent__ = self.context
+ view.__name__ = name
+
return view
raise NotFoundError(self.context, name, request)
- subob = removeAllProxies(subob)
- return ContextWrapper(subob, self.context, name=name)
+ return subob
def browserDefault(self, request):
c = self.context
More information about the Zope3-Checkins
mailing list