HTML() and external methods
I'm creating some external methods and rather than having my python script call a dtml method, I'd prefer to have it call a HTML instance. So I've been doing something like: testHTML = HTML('''<dtml-var hello>''') def externalMethod(self): return testHTML(self,hello="albert") This seems to work as expected. However, if the externalMethod was called from a form action, and the "hello" variable was defined in the form, I'm unable to do something like: def externalMethod(self): return testHTML(self) or def externalMethod(self): return testHTML(self,REQUEST=self.REQUEST) Instead, I have to do def externalMethod(self): return testHTML(self,hello=self.REQUEST['hello']) What's the correct way to do this? Thanks, Albert
Albert Ting writes:
I'm creating some external methods and rather than having my python script call a dtml method, I'd prefer to have it call a HTML instance. ... However, if the externalMethod was called from a form action, and the "hello" variable was defined in the form, I'm unable to do something like: .... def externalMethod(self): return testHTML(self,REQUEST=self.REQUEST)
The "REQUEST" equivalent for "HTML" is "mapping". Dieter
participants (2)
-
Albert Ting -
Dieter Maurer