[Zope] Problems with absolute_url in my product

Dieter Maurer dieter@handshake.de
Tue, 5 Mar 2002 23:00:16 +0100


Paul Tiemann writes:
 > ...
 > I have a class that extends ObjectManager, and that class has another 
 > ObjectManager attribute called 'data', like this:
 > 
 > class MyChildClass( ObjectManager.ObjectManager ):
 >     def __init__(self,id):
 >         self.id = id
 > ...
 > But I wrote a small dtml method ("abs") to show the 
 > absolute_url value for an object ...
 > "<dtml-var absolute_url>"
 > ...
 > http://me:8080/myzopeclass/abs it doesn't show the correct absolute URL.
 > ...
 > Going to http://me:8080/myzopeclass/abs
 > gives http://me:8080/ again, but that's not what I expected
You are sure, "abs" is a DTML Method and not a DTML Document?

"absolute_url" is defined by the mixin class "Traversable".
It should be a superclass of "ObjectManager". If it were not, then
what you see would be understandable: "absolute_url" would be acquired
from the containing folder.

Another potential problem might be that your class does not define
"getId". The result should not be as you describe, though.
You should get the last path segment repeated several times.


Dieter