parsers
deserialize_json_column(value)
Deserializes JSON text of a database column with orjson.
Text orjson rejects (NaN, lone surrogates) falls back to the standard
library json module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
JSON text read from the database |
required |
Returns:
| Type | Description |
|---|---|
Any
|
deserialized value |
Source code in ormar/fields/parsers.py
| Python | |
|---|---|
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
serialize_json_column(value)
Serializes a value of a JSON column for the database with orjson.
Values orjson cannot serialize (integers over 64 bits) fall back to the standard library json module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
value of the JSON column |
required |
Returns:
| Type | Description |
|---|---|
str
|
JSON text of the value |
Source code in ormar/fields/parsers.py
| Python | |
|---|---|
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |