Mailing List Archive

passing multiple variables via the url string
I'm attempting to pass multiple variables via the url string. field1 &
field2 are form variables to be passed on a redirect.

field1 = 'foo'
field2 = 'bar'

For the command below, I do not get a python syntax error unless I remove
the "+" symbols:

return
container.absolute_url()+'/my-documents/?field1='+field1&'field2='+field2

Executing the command returns the following error:

"unsupported operand type(s) for &: 'str' and 'str'"


The "&"symbol from all my research should separate the variables. Does Zope
use some other symbol?

I can successfully pass either field1 or field2 using the same command with
only one variable:

return container.absolute_url()+'/my-documents/?field1='+field1

Thanks... Jim
--
View this message in context: http://www.nabble.com/passing-multiple-variables-via-the-url-string-tf4365954.html#a12444521
Sent from the Zope - DB mailing list archive at Nabble.com.

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: passing multiple variables via the url string [ In reply to ]
> container.absolute_url()+'/my-documents/?field1='+field1&'field2='+field2
>
> Executing the command returns the following error:
>
> "unsupported operand type(s) for &: 'str' and 'str'"
>
>
> The "&"symbol from all my research should separate the variables. Does Zope
> use some other symbol?
No. Your code is wrong because you have '&' outside string:

container.absolute_url()+'/my-documents/?field1='+field1&'field2='+field2
^^^^^

This should be:

container.absolute_url()+'/my-documents/?field1='+field1+'&field2='+field2


BTW. This list is for Zope and database issues.

--
Maciej Wisniowski
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db