[Zope] Interesting namespace observation

Roché Compaan roche@upfrontsystems.co.za
Mon, 27 May 2002 16:45:31 +0200


I have a method in the root of my application called "getProxies"
that queries a catalog for a given metatype.

I have a folder in the root called "Platforms" with a method
called "selectInstance" that renders a series of checkbox tags.

I call "selectInstance" method from an adjacent folder with
<dtml-with Platforms> <dtml-var selectInstance> </dtml-with>

This is how this method look at first:

<dtml-let 
    control_set="setControl(_, 'PlatformID')"
    control_name="control_set[0]"
    control_value="control_set[1]"
    control_type="'checkbox'"
    num_columns="3">

<dtml-in getProxies('Platform') sort="Name" prefix="platform">
<dtml-let
    item="platform_item.id"
    display_item="platform_item.Name">
<dtml-var inputTag>
</dtml-let>
</dtml-in>

</dtml-let>

Doing the above gives a key error for "getProxies", however if
I move "getProxies" into the let tag it does _not_:

<dtml-let 
    control_set="setControl(_, 'PlatformID')"
    control_name="control_set[0]"
    control_value="control_set[1]"
    control_type="'checkbox'"
    num_columns="3"
    proxies="getProxies('Platform')">

<dtml-in proxies sort="Name">
<dtml-let
    item="id"
    display_item="Name">
<dtml-var inputTag>
</dtml-let>
</dtml-in>

</dtml-let>

It seems like <dtml-let> is doing something with the namespace
that makes it impossible for the subsequent <dtml-in> tag to 
find the "getProxies" method in the root.

Any ideas why?

-- 
Roché Compaan
Upfront Systems			http://www.upfrontsystems.co.za