Browse Source

Adding missing files

merge-requests/1/head
Drew Short 7 years ago
parent
commit
54960ee284
  1. 17
      server/atheneum/utility.py

17
server/atheneum/utility.py

@ -0,0 +1,17 @@
from datetime import date
import rfc3339
from flask.json import JSONEncoder
class CustomJSONEncoder(JSONEncoder):
def default(self, obj):
try:
if isinstance(obj, date):
return rfc3339.format(obj)
iterable = iter(obj)
except TypeError:
pass
else:
return list(iterable)
return JSONEncoder.default(self, obj)
Loading…
Cancel
Save