>>> import simplejson                                                           
>>> >>> mypost = request.params.POST('var')
>>> json.loads('[%s]' % mypost[:-1])

Or something like that

You wouldn't have to change your php to send json, python could convert it to 
json

 
Thank you,
Stonly Baptiste
Aston UC is now Veddio Cloud Solutions
954.510.9642-Phone ext.104
877.357.7727-Toll Free ext.104
877.403.7036-Fax
sto...@veddio.com- Email
http://www.veddio.com- Web
‪

Sent via BlackBerry from T-Mobile

-----Original Message-----
From: "Vlad K." <v...@haronmedia.com>
Sender: pylons-discuss@googlegroups.com
Date: Sat, 25 Jun 2011 14:34:57 
To: <pylons-discuss@googlegroups.com>
Reply-To: pylons-discuss@googlegroups.com
Subject: WebOb POST vars like in PHP?


I guess this has probably been asked before, but Google did not return 
anything meaningful.

My question is what would be the best way to supply POST vars in PHP 
notation, that would be converted to a dictionary (in Pyramid):

var[foo]=123 -> becomes request.POST["var"]["foo"] with value 123
var[bar]=456 -> becomes request.POST["var"]["bar"] with value 456

I can write my own function that extracts these from request.POST, but I 
was wondering if I've missed some documentation or an already existing 
lib? Now, I know I can handle hierarchical post data with, say, a JSON 
content type post, but I'm looking for a solution to support client 
developed for PHP backend, without having to rewrite it.

Thanks!

-- 

.oO V Oo.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to