[Zope-dev] How do I call an HTMLFile in context provided by a path

Itai Tavor itai@optusnet.com.au
Fri, 20 Apr 2001 12:48:36 +1000


Tres Seaver wrote:

>Itai Tavor <itai@optusnet.com.au> wrote:
>
>>  Dieter Maurer wrote:
>>
>>  >Itai Tavor writes:
>>  >  > P.S Now that aq_parent is working... why can't I do
>>  >  > absolute_url() on DTMLFiles :-(
>>  >"absolute_url" is provided by the class "OFS.Traverable".
>>  >Apparently, "DTMLFile" is not derived from it.
>>  >
>>  >
>>  >Dieter
>>
>>  Well, obviously... the question is why nobody saw the need to add
>>  Traversable to DTMLFiles...
>
>DTMLFiles are supposed to function as *methods* of their classes;
>methods *don't* have their own 'absolute_url', but return the url
>of the object on which they are called.  DTMLMethods have exactly
>the same semantics:
>
>   <dtml-var absolute_url>
>
>returns the folder/context object's URL, by design.
>
>Tres.

Thanks for replying, and sorry for getting so long to get back to 
your answer. Had a fun week recovering from a hack attack.

Ok, so DTMLFile.absolute_url() should return its container. Except... 
DTMLFiles simply don't have absolute_url - their own or inherited. 
They return an attribute error.

I was going to post a feature request to the collector, but if 
absolute_url on a DTMLFile will return the container, then it's 
pretty useless.

Itai
-- 
--
Itai Tavor                      -- "Je sautille, donc je suis."    --
itai@optusnet.com.au            --               - Kermit the Frog --
--                                                                 --
-- "If you haven't got your health, you haven't got anything"      --