|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
from ZPT(forms) to python scripts?
Hi,
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' They are named this way because of the use of cookies in Plone. 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 04:21 PM. |
|
#2
|
||||
|
||||
|
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. Mark |
|
#3
|
|||
|
|||
|
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" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=__ac_name, __ac_password ##title=login ## from DateTime import DateTime REQUEST=context.REQUEST 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': return context.restrictedTraverse(login_success)() return context.restrictedTraverse(login_failed)() 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 "_" Thanks |
|
#4
|
||||
|
||||
|
Mmmm, ok, that makes no sence. Variables in Python can begin with letters or underscores
![]() for instance... >>> _name = 'value' >>> _name 'value' >>> Mark. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > from ZPT(forms) to python scripts? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|