We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d15c4c5 commit b599cc2Copy full SHA for b599cc2
ormar/fields/parsers.py
@@ -38,6 +38,8 @@ def encode_bytes(value: Union[str, bytes], represent_as_string: bool = False) ->
38
39
40
def encode_json(value: Any) -> Optional[str]:
41
+ if isinstance(value, (datetime.date, datetime.datetime, datetime.time)):
42
+ value = value.isoformat()
43
value = json.dumps(value) if not isinstance(value, str) else re_dump_value(value)
44
value = value.decode("utf-8") if isinstance(value, bytes) else value
45
return value
0 commit comments