mongo wants ObjectIds

This commit is contained in:
James Turk 2011-09-22 12:57:18 -04:00
parent f2c2e2d6f2
commit 5b85dfa4e5

View File

@ -87,7 +87,7 @@ def tracked():
@app.route('/tracked/<id>') @app.route('/tracked/<id>')
def tracked_view(id): def tracked_view(id):
doc = client.db.tracked.find_one({'_id': id}) doc = client.db.tracked.find_one({'_id': pymongo.objectid.ObjectId(id)})
return json.dumps(doc, cls=JSONEncoder) return json.dumps(doc, cls=JSONEncoder)