I am encountering strange behavior when trying to dynamically
set explicit Acquisition within an Acquisition.Implicit object.
The strangeness seems to happen when I refresh the product only,
but I do not feel certain of this which has me a little nervous.

In a Python Product class, named TestAcquisition, I derive
from Folder (which in turn gives me Acquistion.Implicit).  This
class defines an attribute which can dynamically be set to
be acquired from nested TestAcquisition objects.  In order to
do this I test whether the attribute can be acquired (by checking
to see if aq_parent has the attribute).  In the top-level
TestAcquisition object, this attribute should not be acquirable,
and thus it will set it

self.attribute = 1

In sub-objects of TestAcquisition, by default the attribute will
be acquired (which I test and do in manage_afterAdd) by setting

self.aq_explicit.attribute = Attribute.Acquired

I can dynamically unset and set sub-objects acquisition of this
attribute simply by setting

self.attribute = 2


self.aq_explicit.attribute = Attribute.Acquired

within the TestAcquistion sub-object.  This seems to be working
as desired until I refresh the Product, even just simply adding
a pdb.set_trace() as the only change.  After the refresh all
the subobjects that had explicitly been set to acquire the attribute
all return the Special Acquisition Object (Acquisition.Acquired) instead
of the desired value to be acquired.

Is this a bug, something I just have to live with, or am I missing
something on acquisition in my product?  I'd really like to keep the
implicit acquisition and not switch to Acquisition.Explicit.

Thanks in advance!


Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to