ObjectId moved to bson
This commit is contained in:
parent
e6ae2ad634
commit
43d4979913
@ -4,7 +4,7 @@ import datetime
|
|||||||
import functools
|
import functools
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
import pymongo.objectid
|
import bson.objectid
|
||||||
|
|
||||||
from oyster.conf import settings
|
from oyster.conf import settings
|
||||||
from oyster.core import kernel
|
from oyster.core import kernel
|
||||||
@ -14,7 +14,7 @@ class JSONEncoder(json.JSONEncoder):
|
|||||||
def default(self, obj):
|
def default(self, obj):
|
||||||
if isinstance(obj, datetime.datetime):
|
if isinstance(obj, datetime.datetime):
|
||||||
return obj.isoformat()
|
return obj.isoformat()
|
||||||
elif isinstance(obj, pymongo.objectid.ObjectId):
|
elif isinstance(obj, bson.objectid.ObjectId):
|
||||||
return str(obj)
|
return str(obj)
|
||||||
else:
|
else:
|
||||||
return super(JSONEncoder, self).default(obj)
|
return super(JSONEncoder, self).default(obj)
|
||||||
|
Loading…
Reference in New Issue
Block a user