[Zope] namespace problem

Ulrich Wisser liste@publisher.de
Tue, 12 Feb 2002 13:44:31 +0100


Hi,

How can I use named arguments and still have
the namespace available for the method?

Here follows what I do and why I have the problem:

I have a dtml-method which is supposed to
output a <select>...</select> form element. To
do this it needs a loop over the results of an
ZSQL method. The ZSQL method should only
return rows with one special value. So it
look like this

ZSQL method "sites" (name is of course a defined
argument) in folder "/sql"
SELECT FROM SITES WHERE NAME=<dtml-sqlvar name type=string>

DTML-Method "site" in folder "choose":
   <dtml-in "sql.sites(name=sitename)">

And I want to call the DTML-Method like this
<dtml-var "choose.site(sitename=parsedname)">

The problem is, if I call the dtml-method like this
it won't work. I need to call it like
   <dtml-var "choose.site(_.None,_)">

But in that case I can not of named arguments like
"sitename=parsedname" and I have to set "sitename" via
the REQUEST object.

I find this very unelegant. How can I use named arguments
and still have the namespace available for the method?

Thanks

Ulrich
-- 
Searchengine Know How  - Webpromotion - Optimization - Internal Search
World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg
http://www.publisher.de   Tel: +46-8-53460905    Fax: +46-8-534 609 06