[Zope] external methods

Service Informatique CHSR chsrinfo@guetali.fr
Tue, 30 Mar 1999 10:12:54 +0400


>Nope,
>
>With that definition, my_method expect to be called with the arguments
>set, eg <!--#var "my_method('Zope')"--> to display "Zope is cool".
>
>However, I want to get the variable l from the namespace. (application
>variables made with REQUEST.set, Folder or document properties, etc.)
>The question was: is self.REQUEST the only way to access the
>variable namespace? And the only way to *modify* the variable namespace
>from external methods (with self.REQUEST.set)?


I'd like to be more precise. Suppose my_method is:

def my_method(self):
    if self.REQUEST.has_key('my_var'):
        return "oh yes"
    return "boooo"


Now, I write in DTML:

<p><!--#var my_method--></p>
<p><!--#with "_.namespace(my_var='my_value')"-->
<!--#var my_method--><br>
<!--#var my_var-->
<!--#/with--></p>

Believe me or not, the result is:

boooo
boooo
my_value

You can now understand why I ask how to access the variable
namespace from external methods. How can I test the existence
of my_var, and access its value???

Keep the good work, I might ask you some of your photos for
my daily worship :-)

Regards,
Jephte CLAIN
Service Informatique