idkravitz / ttb-game

Turn-based strategy game, educational development
GNU General Public License v3.0
2 stars 2 forks source link

Huge problem with JSON handling #9

Closed idkravitz closed 14 years ago

idkravitz commented 14 years ago

So we have a huge problem with server side JSON handling. When we send data by jquery getJSON: 1. each value have a string type. 2. It can't handle nested objects and arrays. We need to find solution and quick.

idkravitz commented 14 years ago

I posted a question 'bout it on stackoverflow and as you can see for this moment there is only one answer, which implies a use of json2.js library to convert all data to string on client side before sending. Yep, this solution will work, but chain isn't good: JSON -> String -> JSONDecoder -> Python Data Structures.

There is a way to remove one link if we get a non-standart JSONDecoder for query strings. And it will simplify in something like JSON -> QueryStringJSONDecoder -> Python Data Structures.

The only difficulty is that ugly solution can be performed out of the box, but nice solution isn't available at all (if I googled enough). So we can write a decoder or agree on json2.js

idkravitz commented 14 years ago

Fixed in first way dce7ba7eccabfa2fbc247305b5f45eb59bbe3105