(self, obj)
| 46 | |
| 47 | class GenericJSON(JSONEncoder): |
| 48 | def default(self, obj): # pylint: disable=method-hidden |
| 49 | if hasattr(obj, "__json__") and six.callable(obj.__json__): |
| 50 | return obj.__json__() |
| 51 | elif isinstance(obj, bson.ObjectId): |
| 52 | return str(obj) |
| 53 | else: |
| 54 | return JSONEncoder.default(self, obj) |
| 55 | |
| 56 | |
| 57 | def default(obj): |