[Zope] Acquisition: DTML Methods vs Documents

Oleg Broytmann Oleg Broytmann <phd@mail2.phd.pp.ru>
Tue, 9 Jan 2001 14:05:52 +0300 (MSK)


Hello!

   Many thanks to all who replied! Sorry for late answer - twas XMas
holidays in Russia (Russian Orthodox church celebrates XMas Jan 7).

On Fri, 5 Jan 2001, Rik Hoekstra wrote:
> >    If I call http://machine:port/top/middle/AFolder/ADocument (in terms of
> > this HOWTO), and ADocument calls <dtml-var AMethod>, what is acquisition
> > path for AMethod?
>
> what might come handy in your case is the howto "Shane's Aquisition
> Understander" at
>
>  http://www.zope.org/Members/chrisw/showaq
> it'll help you visualize the acquisition path from your document.

   I used it for sometime, sure...

> You may also want to look at my howto Changing Contexts in Zope
> http://www.zope.org/Members/Hoekstra/ChangingZopeContexts

   Read and reread it many times, sure. Cannot live without it :) The thing
that I didn't understand from this (and the thing is still cloudy) is that
there is One Acquisition Path for a request. When I call a Method through
the web, I have proper path, so I can call Documents and Methods from each
other. But when I call a Document through the web, I have "wrong" path -
static path, and when I try to call a Method from the Document, the Method
will use this static path. I thought the Method will use dynamic path,
based on request (URL). That was my mistake.

> Or Jim's acquisition algebra from a Python point of view of these matters:
> http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/index.html

   Of course.

Oleg.
----
     Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.