Accessing a zope object stripped of acquisition

To get an object completely stripped of its acquisition layers, the following snippet can be employed

import Acquisition
obj_no_aq = Acquisition.aq_base(obj)

No acquisition means no methods or properties inherited from the container or the container chain.

Although a bit old, the Zope Developer Guide, with its chapter on Acquisition do a fine job at explaining the intricacies of acquisition in Zope 2.

Comments