Steve Alexander wrote:
> Does the method aq_inContextOf() do what you want?
Not really, sicne it's not linked to the URL traversal, which PARENTS
is.
Or am I getting that wrong? ;-)
> However, someone could write a Product with a class that doesn't support
> Acquisition. I think I'd consider th
Chris Withers wrote:
>
>
> Two questions:
>
> 1. Is there a better way of doing the above?
Does the method aq_inContextOf() do what you want?
http://www.zope.org/Members/michel/Projects/Interfaces/AcquisitionWrappedObject
aq_inContextOf(other [, inner])
Check whether the object is in th
Steve Alexander wrote:
> > Do you know if objects in PARENTS are acquisition wrapped?
>
> I'm pretty sure that they are.
They are indeed, in fact, pretty much everything is :(
The only way to check if o is in PARENTS appears to be:
if o.aq_base in map (lambda o : o.aq_base,PARENTS):
..nice...
Chris Withers wrote:
>
> ...or have you been bitten by this before?
Nope -- I just like reading impenetrable documentation :-)
> Do you know if objects in PARENTS are acquisition wrapped?
I'm pretty sure that they are.
Anyway, I was wrong in my last email -- you should be comparing using
the
Steve Alexander wrote:
> Smells like an Acquisition Wrapper misunderstanding :-)
You should change your name to Jim...
...or have you been bitten by this before?
Do you know if objects in PARENTS are acquisition wrapped?
cheers and much we're-not-worthy'ing,
Chris
___
Chris Withers wrote:
>
> I was trying to use 'if o in REQUEST.PARENTS' to expand branches on the
> way to the currently displayed object and was running into trouble which
> lead me to try out the following code:
>
> `REQUEST.PARENTS[0]`+`o`+`o==REQUEST.PARENTS[0]`+`o is
> REQUEST.PARENTS[0]`
>