python/bottle and returning a dict
Question: I am using python/bottle to return a dict/json to my android app ( the app
using GSON to parse into JSON). It doesn't seem to parse the python text
correctly.

Here is what python returns:

    
    
    [{u'slot': -1.0, u'rnd': -1.0}]
    

But Gson sets slot = 0 and round =0, so it is either not reading it properly
or just setting it to default values. How can I get python to not return the
unicode encoded string and just a regular or string. Here is the offending
python code

    
    
    ...
    return str(move)
    

Move is the object the is returned for a pymongo find query and at the time of
test it was [{u'slot': -1.0, u'rnd': -1.0}], well python added the 'u', when
we look at the values in rockmongo it doesn't have the 'u'.


Answer: If you want bottle to turn your dict into JSON, then return the dict. Not
str(...), not a list with a dict in it, but just the dict.

Example:

    
    
    from bottle import route
    
    @route('/some/path')
    def some_callback():
        return {'slot': -1.0, 'rnd': -1.0}
    

