I've frankly never tried to pass two values with the same name, so I have no idea how I'd do it. I suppose I'd extend the CSV beyond the RFC 4180 by adding in subfields and a seperator of '^' as is commonly done. Yes, building your own serialization is a task to be done. You'd have to do that anyway if you didn't use jQuery. de-serialization (aka parsing) on the other hand could be handled much the same way as json, import a library, deserialize.
Overall, the cost isn't any different than JSON. https://github.com/nodeca/js-yaml You could use a jscript based parser and serializer. https://code.google.com/p/jquery-csv/ The main benefit with going from JSON to CSV is of course multiple rows. On Monday, June 10, 2013 12:15:31 PM UTC-7, Niphlod wrote: > > uhm. web2py handles usual encoded forms in multipart/form-data and > application/x-www-form-urlencoded without problems. Additionally recent > releases parse automatically into request.vars all requests that POST a > json body if they're handled with content-type : application/json. > Inspect your POSTs with something like firebug to spot the issue you're > facing. > > @david: Posting YAML isn't quite a standard, although preferred to CSV, > that is the most horrible way to pass around values for forms. CSV is good > for passing around table data, but is not supported by any browser > "natively" (i.e. you must build your own CSV serialization)...YAML has the > exact same issue, but CSV has a major limit... How do you pass two values > with the same name as {id : [1, 2] } with CSV :-D ? > > On Monday, June 10, 2013 7:10:41 PM UTC+2, Derek wrote: >> >> Post the whole traceback. >> >> Also, I just want to make the comment that what you put here is not valid >> json... >> {'POST' : 'query POST'} >> >> Single quotes aren't allowed. >> Verify your json by going here: >> >> http://jsonlint.com/ >> >> Also, before using JSON you might want to read the spec. >> http://www.json.org/ >> >> Any reason why you are using JSON? In most cases it's very inefficient. >> I'd recommend CSV or YAML. >> >> On Monday, June 10, 2013 9:54:19 AM UTC-7, Carl wrote: >>> >>> I am passing the string {'POST' : 'query POST'} to my Web2py server code. >>> >>> Looking at gluon/main/py and tracing into sj.load(body) at line 225 >>> leads to Python/Lib/json/decoder.py but eventually gets to errmsg(), >>> line 36, with >>> msg = Expecting proper name. >>> doc = [{'POST' : 'qwerty POST'}] >>> pos = 2 >>> end = None >>> >>> I bet the answer is obvious (!) but can you point it out? >>> >>> -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

