From: "Christian Scholz" <[EMAIL PROTECTED]>
> And can someone explain to us where the differences between
> aq_chain and getPhysicalPath() are? Actually getPhysicalPath()
> seems also to walk up aq_parent. Or am I missing something?

"aq_chain" gives you a list of the objects traversed to get to your object,
in reverse order.

"getPhysicalPath" gives you a tuple of the Ids of all objects on the
shortest path from the root to your object.

So, given a hierarchy like this:


Object C has physical path ('', 'A', 'B', 'C') no matter how you get to it.
Its acquisition chain, on the other hand, depends completely on the path you
use to access it:

A/B/C => [C, B, A]
A/D/B/C => [C, B, D, A]
A/B/D/E/C => [C, E, D, B, A]

*WARNING*: "aq_chain" does *not* tell you the order in which acquisition
will search the objects.  That is more complicated.


Evan @ digicool

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to