This file contains hidden or 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
def make_ndb_return_data_json_serializable(data): | |
"""Build a new dict so that the data can be JSON serializable""" | |
result = data.to_dict() | |
record = {} | |
# Populate the new dict with JSON serializiable values | |
for key in result.iterkeys(): | |
if isinstance(result[key], datetime.datetime): | |
record[key] = result[key].isoformat() |
NewerOlder