Default function¶
- django_orjson.default(obj)[source]¶
A function for use with orjson’s
defaultparameter that extends orjson to support serializing these extra types:Django’s
Promiseobjects, as used for lazy translations
This function is analogous to Django’s
DjangoJSONEncoder, which extends the standard libraryjsonmodule support to the above types. You won’t typically need to use this function directly, as it is used internally by the other utilities in this package.