Also, I think that : "else" should be : "else:" Pascal -----Message d'origine----- De : zope-bounces@zope.org [mailto:zope-bounces@zope.org]De la part de Vangelis Mihalopoulos Envoyé : mardi 29 mars 2005 14:03 À : prabuddha ray Cc : zpugdc@zope.org; zope@zope.org Objet : Re: [Zope] python prob Indentation maybe? the if-else part should be on the outer indent like...... req = container.REQUEST RESP = request.RESPONSE user=req.username pwd=req.password # chkpwd is a ZSQL method taking username as arg and giving its correspong passwd if container.chkpwd(user)==pwd : # it givs syntax error here RESP.redirect(test) else RESP.redirect(index_html) prabuddha ray wrote:
i'm kinda new to python ; wanted to build an intermediate scrip python for redirection from a ZPT . code tried is
req = container.REQUEST RESP = request.RESPONSE
user=req.username pwd=req.password # chkpwd is a ZSQL method taking username as arg and giving its correspong passwd if container.chkpwd(user)==pwd : # it givs syntax error here RESP.redirect(test) else RESP.redirect(index_html)
plz help
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
Also, i don't think that ZSQL methods return a simple string, so the comparison is between wrong types of objects.... Pascal Peregrina wrote:
Also, I think that :
"else"
should be :
"else:"
Pascal
-----Message d'origine----- De : zope-bounces@zope.org [mailto:zope-bounces@zope.org]De la part de Vangelis Mihalopoulos Envoyé : mardi 29 mars 2005 14:03 À : prabuddha ray Cc : zpugdc@zope.org; zope@zope.org Objet : Re: [Zope] python prob
Indentation maybe? the if-else part should be on the outer indent like......
req = container.REQUEST RESP = request.RESPONSE
user=req.username pwd=req.password # chkpwd is a ZSQL method taking username as arg and giving its correspong passwd if container.chkpwd(user)==pwd : # it givs syntax error here RESP.redirect(test) else RESP.redirect(index_html)
prabuddha ray wrote:
i'm kinda new to python ; wanted to build an intermediate scrip python for redirection from a ZPT . code tried is
req = container.REQUEST RESP = request.RESPONSE
user=req.username pwd=req.password # chkpwd is a ZSQL method taking username as arg and giving its correspong passwd if container.chkpwd(user)==pwd : # it givs syntax
error here
RESP.redirect(test) else RESP.redirect(index_html)
plz help
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com **********************************************************************
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
--On Dienstag, 29. März 2005 16:25 Uhr +0300 Vangelis Mihalopoulos <mihalop@VTrip.NET> wrote:
Also, i don't think that ZSQL methods return a simple string, so the comparison is between wrong types of objects....
Reading existing documentation as the RDBMS chapter of the Zope Book helps a lot in this case :-) -aj
participants (3)
-
Andreas Jung -
Pascal Peregrina -
Vangelis Mihalopoulos