[Zope] erroneous use of "aq_parent" (was: Where is my BtreeFolder stored?)

Dieter Maurer dieter at handshake.de
Sat Nov 29 03:31:41 EST 2008

Mr SZ wrote at 2008-11-27 07:09 -0800:
> ...
>def test4():
>    if 'suftest' in aq_parent.objectIds():
>        return 'True'
>class OOBStuff(BTreeFolder2):
>      meta_type ='OOBStuff'
>      def __init__(self, oid,dict_to_add):
>         super(OOBStuff, self).__init__(oid)
>         self.item = OOBTree()
>         self.item['Auth'] = dict_to_add
>      def return_Tree(self):
>          return self.item 
>Running test4 gives this error:
>Error Type: AttributeError
>Error Value: 'builtin_function_or_method' object has no attribute 'objectIds'

"aq_parent" obviously is the object, you have imported from
"Acquisition". This is a function and obviously does not have an
"objectIds". You need to apply "aq_parent" to some object to
(hopefully) get an object with "objectIds".


More information about the Zope mailing list