[Zope] Acquisiton Wrappers bite ;-)
Chris Withers
fresh@bay-c.co.uk
Wed, 11 Oct 2000 20:16:15 +0100
Ron Bickers wrote:
> This returns the following when in the root folder context:
>
> <TinyTable instance at 8684ad8>
> <TinyTable instance at 8684ad8>
> 0
the above is a bit misleading ;-)
The two objects aren't actually at the same address 'cos your comparison
is actually of the acquisiton wrappers that are wrapping your TinyTable
object...
> <dtml-var "PARENTS[-1].myObject is myObject">
This comparison will never return true for that reason...
> <dtml-var "PARENTS[-1].myObject == myObject">
...this one will return true in the next version of Zope, in the above
example...
To do comparisons like this, though, you really need to be in an
external method or other unrestricted python so you can get access to
.aq_base, which is the real object you're dealing with...
have fun,
Chris :-)