Changes between Version 4 and Version 5 of Ticket #35071, comment 12


Ignore:
Timestamp:
Jan 1, 2024, 1:56:49 PM (9 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35071, comment 12

    v4 v5  
    1414}}}
    1515
    16 We also can't make `encoder` default to `DjangoJSONEncoder` as it elides the original type so you'd be able to serialize uuid, datetimes, etc but not get them back which breaks the principle of least astonishment IMO. `DjangoJSONEncoder` works well for the serialization framework as it is equipped which a deserialization schema (model definition) so type information can be restored but `JSONField` are schema less so it's not a good ''default''.
     16We also can't make `encoder` default to `DjangoJSONEncoder` as it elides the original type so you'd be able to serialize uuid, datetimes, etc but not get them back which breaks the principle of least astonishment IMO. `DjangoJSONEncoder` works well for the serialization framework as it is equipped with a deserialization schema (model definition) so type information can be restored but `JSONField` are schema less so it's not a good ''default''.
Back to Top