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

Steve Alexander [email protected]
Thu, 25 Oct 2001 10:24:49 +0100


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


Maybe you meant to write out "self" instead of "req".


Also, please do not cross-post to both the zpatterns list and the 
[email protected] list. Post your question to either one list or the other.

--
Steve Alexander
Software Engineer
Cat-Box limited