January 16th, 2004, 05:13 PM
from ZPT(forms) to python scripts?
Im now working with forms from zope page templates. Im accepting inputs of the Username and Password. The names of the input on the forms are '__ac_name' and '__ac_password'
I would then create a python script but i couldnt pass in the parameter because "_" is not a valid character for parameters. I figure a variable passed is only a string. Is there any way around this?
Last edited by JuiceMan; January 16th, 2004 at 05:21 PM.
January 16th, 2004, 05:34 PM
To be honest you lost me on that last part, how do you mean '_' is not a valid parameter?
Do you have a any code you could show us, might make what you're wanting to do a little clearer... or at least to me
Or maybe you could explain exactly what you want this Python script to do? On what platform/server etc.
January 16th, 2004, 06:03 PM
I'm sorry for not being clearer.
The python script is from Plone's dropdown menu.
The variable that I am trying to get from the form is named '__ac_name' and the double underscore at the front isnt valid in python.
## Script (Python) "logged_in"
from DateTime import DateTime
name = REQUEST.get('__ac_name')
password = REQUEST.get('__ac_password')
success = context.checkPassword(name, password)
login_failed = 'login_failed'
login_success = 'login_success'
if success == 'true':
I'm working from the ZMI and the zmi gives me this error message:
Line 1: "__ac_name" is an invalid variable name because it starts with "_"
Line 1: "__ac_password" is an invalid variable name because it starts with "_"
January 16th, 2004, 07:38 PM
Mmmm, ok, that makes no sence. Variables in Python can begin with letters or underscores
>>> _name = 'value'