djblets.util.serializers¶
-
class
DjbletsJSONEncoder
(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding=’utf-8’, default=None)[source]¶ Bases:
django.core.serializers.json.DjangoJSONEncoder
A JSON encoder that supports lazy strings, datetimes, and some models.
This is a specialization of
DjangoJSONEncoder
the does the following:- Evaluates strings translated with
ugettext_lazy()
orgettext_lazy()
to real strings. - Removes the milliseconds and microseconds from
datetimes
. - Serializes Django
models
with ato_json
method via that method.
- Evaluates strings translated with