sjsonhelper.py 186 Bytes
Newer Older
Muhammad Yafi's avatar
Muhammad Yafi committed
1
2
3
4
5
6
7
import json

class JSONEncoder(json.JSONEncoder):
    def default(self, o):
        if isinstance(o, ObjectId):
            return str(o)
        return json.JSONEncoder.default(self, o)