On 26/06/2011 12:04, Vlad K. wrote:

Thanks for your reply, but the problem is there is no
request.POST("var"), there is request.POST("var[foo]") and at that point
I don't know all the possible values of "foo". I solved with with a
custom extraction function.

I'd strongly recommend you look at colander:

http://docs.pylonsproject.org/projects/colander/dev/

...if you just want extraction of structured data from requests.

If you want full form generation, then move on to using deform.

cheers,

Chris

But I can't trust that the order given in the form is the same given
through POST

Yes, you can.

and especially the same reconstructed via WebOb's multidict
entities (since Python's dicts are not ordered).

WebOb's multidicts are ordered.

Suggestions (I mean, other than using a lib or function that parses
foo[id], bar[id], ...)?

If you have to re-write a server without changing a client form then yes, your best bet *is* to write a function that mimics what PHP's extraction does.

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
           - http://www.simplistix.co.uk

--
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