Commit 90c07455 authored by Casey Duncan's avatar Casey Duncan

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.
parent 04953625
......@@ -13,7 +13,7 @@
"""Commonly used utility functions."""
__version__='$Revision: 1.16 $'[11:-2]
__version__='$Revision: 1.17 $'[11:-2]
import sys, os, time
......@@ -90,7 +90,9 @@ def is_acquired(ob, hasattr=hasattr, aq_base=aq_base, absattr=absattr):
# 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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment