Add DjbletsJSONEncoder for lazy string and datetime serialization.
Review Request #5473 — Created Feb. 15, 2014 and submitted
We had two places where datetimes were serialized to chop off the
extra precision. Turns out we needed a third, for json_dumps. These
other places also didn't know how to handle lazy strings, which only
json_dumps
knew how to do.There's now a
DjbletsJSONEncoder
that can take on these
responsibilities.BasicAPIEncoder
,ResourceAPIEncoder
, andjson_dumps
now make use of this instead ofDjangoJSONEncoder
.
RB and Djblets unit tests pass.
Verified that the timestamps from
json_dumps
no longer had the
extra precision that was causing unwanted message bubbles in RB.