Created
June 6, 2012 21:01
-
-
Save jassinm/2884734 to your computer and use it in GitHub Desktop.
dumps a json including dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime.datetime) else None | |
def jsonify(data): | |
return Response(json.dumps(data, default=dthandler)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment