calling Python Script from dtml-let
I have a simple Python Script called passwordRandom(). It works fine if I call it with: <dtml-call "REQUEST.set('password', passwordRandom())"> But I want that value to be available for some other things, so I want to set a variable with dtml-let. But if I do: <dtml-let password2 = "passwordRandom()"> (with a </dtml-let> further down) Then I get invalid parameter: "password = "passwordRandom()"", for tag <dtml-let password = "passwordRandom()">, on line 18 of ActivateAccountHack What stupid mistake am I making?
Hi, Am Mo, den 18.10.2004 schrieb Bill Seitz um 3:03:
I have a simple Python Script called passwordRandom().
It works fine if I call it with: <dtml-call "REQUEST.set('password', passwordRandom())">
But I want that value to be available for some other things, so I want to set a variable with dtml-let.
You dont need to. If you use REQUEST.set, you have the variable automatically in the namespace for DTML.
But if I do: <dtml-let password2 = "passwordRandom()"> (with a </dtml-let> further down)
I think you must do <dtml-let "password2 = passwordRandom()"> or something along. Read the reference if you really want to do DTML :) Btw. Python does not bite. Code looks much cleaner in python scripts - the expressions are the same but without a lot of strange < ...> tags around them :-) Regards Tino
Bill Seitz wrote:
But if I do: <dtml-let password2 = "passwordRandom()"> (with a </dtml-let> further down)
Then I get
invalid parameter: "password = "passwordRandom()"", for tag <dtml-let password = "passwordRandom()">, on line 18 of ActivateAccountHack
What stupid mistake am I making?
Remove the whitespace before and after the equatation mark. wrong: <dtml-let password2 = "passwordRandom()"> right: <dtml-let password2="passwordRandom()"> Cheers, Maik
participants (3)
-
Bill Seitz -
Maik Jablonski -
Tino Wildenhain