Python / Bottle / MongoDB: Неподдерживаемый тип ответа:

@route('/locations', method='GET')
def get_location():
    entity = db['locations'].find({'coordinate2d': {'$near': [37.871593, -122.272747]}}).limit(3)
    if not entity:
        abort(404, 'No nearby locations')
    return entity

Ответ для приведенной выше части кода:

Error 500: Internal Server Error

Sorry, the requested URL 'http://localhost:8080/locations' caused an error:

Unsupported response type: <type 'dict'>

Как я могу получить эту информацию из mongo, поскольку тип Bottle может возвращать как JSON?

5
задан james_womack 20 February 2012 в 09:05
поделиться