[Zope-dev] Acquisition Wrappers Bit Again ;-)

Chris Withers chrisw@nipltd.com
Thu, 17 Aug 2000 19:13:14 +0100


Carl Robitaille wrote:
>  <dtml-var "_.getitem('sequence-item')">
>  <dtml-var "images">
>  <dtml-var "_.getitem('sequence-item')==images">

> <Folder instance at 85cf958>
> <Folder instance at 85cf958>

Congratulations, you've just been bitten by the thing that confused me
for half a day...
You see, while they say <Folder instance at 85cf958>, they're actually
lying ;-)

The objects you're comparing are actually acquisition wrappers.

IMHO, == should work with acquisition to make problems like the above
not happen. I suggested this, and Jim Fulton agreed:
http://zope.nipltd.com/public/lists/dev-archive.nsf/ByKey/08240A8E0D50AEE0 

Sadly, nothing seems to have been done about it :(
Maybe you should chuck it in the collector as a bug in the
ExtensionClass?

cheers,

Chris

PS: In the meantime, the following should work:

 <dtml-in "objectValues(['Folder'])">
 
  <dtml-if
"_.getattr(_.getitem('sequence-item'),'aq_base',_.getitem('sequence-item'))==_.getattr(images,'aq_base',images)">
    EQUAL
  <dtml-else>
    NOT EQUAL
  </dtml-if>
 
 </dtml-in>