Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 16th, 2004, 04:13 PM
JuiceMan JuiceMan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 JuiceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old January 16th, 2004, 04:34 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #3  
Old January 16th, 2004, 05:03 PM
JuiceMan JuiceMan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 JuiceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old January 16th, 2004, 06:38 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Mmmm, ok, that makes no sence. Variables in Python can begin with letters or underscores

for instance...

>>> _name = 'value'
>>> _name
'value'
>>>

Mark.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > from ZPT(forms) to python scripts?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap