[ZPatterns] what I'm doing wrong? PlugIns bug?

Juan David Ibáñez Palomar palomar@sg.uji.es
Thu, 25 Oct 2001 13:37:01 +0200


Steve Alexander wrote:

> Antonio Beamud Montero wrote:
> 
>> I have discover more data about this problem.
>>
>> The list of object references I try to show in the dtml method is ok,
>> but this object instances aren't Acquisition Wrappers... but why one
>> moment before they are?
>>
>> In the Traversable code I put one line like this:
>>
>>   def absolute_url(self, relative=0):
>>         try:
>>             req = self.REQUEST
>>         except AttributeError:
>>             req = {}
>> ->      open('/tmp/kk', 'w').write(str(req))
>>         rpp = req.get('VirtualRootPhysicalPath', ('',))
>>         spp = self.getPhysicalPath()
>>
>>
>> And the contents of /tmp/kk is: (Thanks to Juan David Ibañez)
>> <Special Object Used to Force Acquisition>
> 
> 
> 
> Well, that's spooky. You're looking at what REQUEST is in the 
> absolute_url method, and you're getting something that looks like the 
> special object Acquisition.Acquired.
> 
> I can't think what would cause this, other than having this in one of 
> your class definitions:
> 
>   from Acquisition import Acquired, Explicit
> 
>   class FooBar(Explicit, Persistent, ...):
> 
>     REQUEST=Acquired
> 
>



The SimpleItem class has the attribute REQUEST:

     # Attributes that must be acquired
     REQUEST=Acquisition.Acquired

Probably his class simply inherits from SimpleItem. The problem seems
to be that "self" is not an acquisition wrapper as it should.

Perhaps the problem is related with Python 2.2. Is there any known
problem with ExtensionClass/Acquisition and Python 2.2? Antonio,
could you try it with Python 2.1?


jdavid