Mailing List Archive

[Zope-PTK] Acquisition of properties?
Given the following folder tree:

/
XXX
YYY

Where XXX and YYY both contain property sheets with properties
defined, the "YYY" folder contains a "discuss" DTML method, and the
"XXX" folder is a PortalFolder and contains a "test" DTML Method
that reads something like:

<dtml-var standard_html_header>
<dtml-with YYY>
<dtml-var "discuss()">
</dtml-with>
<dtml-var standard_html_footer>

Why, when viewing "WWW/test", can't the "discuss" method find the
properties defined on YYY? I thought I understood acquisition...

--
J C Lawrence Home: claw@kanga.nu
----------(*) Other: coder@kanga.nu
--=| A man is as sane as he is dangerous to his environment |=--
Re: [Zope-PTK] Acquisition of properties? [ In reply to ]
On Sun, 27 Feb 2000 10:26:48 -0800
J C Lawrence <claw@kanga.nu> wrote:

> Given the following folder tree:

> / XXX YYY

> Where XXX and YYY both contain property sheets with properties
> defined, the "YYY" folder contains a "discuss" DTML method, and
> the "XXX" folder is a PortalFolder and contains a "test" DTML
> Method that reads something like:

> <dtml-var standard_html_header> <dtml-with YYY> <dtml-var
> "discuss()"> </dtml-with> <dtml-var standard_html_footer>

> Why, when viewing "WWW/test", can't the "discuss" method find the
> properties defined on YYY? I thought I understood acquisition...

Aaargh. That should be "XXX/test" of course. Same question holds
tho.

--
J C Lawrence Home: claw@kanga.nu
----------(*) Other: coder@kanga.nu
--=| A man is as sane as he is dangerous to his environment |=--
Re: [Zope-PTK] Acquisition of properties? [ In reply to ]
----- Original Message -----
From: "J C Lawrence" <claw@kanga.nu>
To: <zope@zope.org>; <zope-ptk@zope.org>
Sent: Sunday, February 27, 2000 1:26 PM
Subject: [Zope-PTK] Acquisition of properties?


> Given the following folder tree:
>
> /
> XXX
> YYY
>
> <dtml-var standard_html_header>
> <dtml-with YYY>
> <dtml-var "discuss()">
> </dtml-with>
> <dtml-var standard_html_footer>
>
> Why, when viewing "WWW/test", can't the "discuss" method find the
> properties defined on YYY? I thought I understood acquisition...

It's because you've lost your namespace. If you do,

<dtml-var standard_html_header>
<dtml-with YYY>
<dtml-var discuss>
</dtml-with>
<dtml-var standard_html_footer>

you should get what you want. Or,
<dtml-var "discuss(_.None, _)">

<dtml-var discuss> is equivalent to <dtml-var name=discuss>. When called
that way, a DTML method is automatically given the namespace. <dtml-var
expr="discuss(_.None, _)"> would be the syntax to make sure that the
namespace is passed in to the DTML method when calling as an expression.

Kevin