[Zope-Checkins] CVS: Zope/lib/python/App - Common.py:1.17

Casey Duncan casey@zope.com
Fri, 15 Nov 2002 14:21:56 -0500


Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv16216

Modified Files:
	Common.py 
Log Message:
Minor change to is_acquired function: __getitem__ lookups now use the wrapped
parent to allow the parent to acquire things like CMF tools during lookup.
Note that this relies on the unwritten assumption that __getitem__ will not
acquire things as getattr will.


=== Zope/lib/python/App/Common.py 1.16 => 1.17 ===
--- Zope/lib/python/App/Common.py:1.16	Tue Sep  3 02:09:04 2002
+++ Zope/lib/python/App/Common.py	Fri Nov 15 14:21:56 2002
@@ -90,7 +90,9 @@
         # Use __getitem__ as opposed to has_key to avoid TTW namespace
         # issues, and to support the most minimal mapping objects
         try:
-            if aq_base(parent[absId]) is aq_base(ob):
+            # We assume that getitem will not acquire which
+            # is the standard behavior for Zope objects
+            if aq_base(ob.aq_parent[absId]) is aq_base(ob):
                 # This object is an item of the aq_parent, its not acquired
                 return 0
         except KeyError: