Greetings All, I feel pretty dense asking this question, but I can't seem to find the answer anywhere. How do I pass a namespace variable to a python script from a DTML document. The zope book says to do this... <dtml-call expr="updateInfo(color='brown', pattern='spotted')"> But these values are hardcoded, and that's no good cause I need to pass a variable. I've tried a bunch of different ways but nothing seems to work (I either get a syntax error or a type error). I had thought that just substituting <dtml-var color> for 'brown' in the above example might work, but it doesn't. I then tried to quote the dtml-var tag (that just produced a type error), and then tried to reference the REQUEST object (like this color=REQUEST.color) and again it produced a type error. I've tried the following things... color=<dtml-var color> color='<dtml-var color>' color=REQUEST.color color=&dtml-color color=_['color'] color=color None of these work, and I can't seem to find any docs on how to make it work (I'm assuming that it does work somehow still at this point). Can anyone out there give me the correct syntax, or reference to the correct syntax? I'd be eternally grateful to anyone who can set me straight on this. Sincerely, Jason
On Wed, 2002-09-04 at 12:22, Jason Burke wrote:
Greetings All,
I feel pretty dense asking this question, but I can't seem to find the answer anywhere.
How do I pass a namespace variable to a python script from a DTML document. The zope book says to do this...
<dtml-call expr="updateInfo(color='brown', pattern='spotted')"> [snip] color=color
This is the right one. if it is not working, perhaps the variable does not actually exist. Does <dtml-var color> work?
Jason Burke writes:
... How do I pass a namespace variable to a python script from a DTML document. The zope book says to do this...
<dtml-call expr="updateInfo(color='brown', pattern='spotted')">
But these values are hardcoded If "variable" is a DTML variable, then you can (e.g.) use:
<dtml-call expr="updateInfo(color=variable, pattern='spotted')"> Dieter
participants (3)
-
Dieter Maurer -
Jason Burke -
Mark Roach