Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

passing multiple variables via the url string

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


onsombal at yahoo

Sep 1, 2007, 3:03 PM

Post #1 of 2 (907 views)
Permalink
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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db


maciej.wisniowski at coig

Sep 1, 2007, 3:40 PM

Post #2 of 2 (867 views)
Permalink
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[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-db

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.