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


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35071, comment 12

    v3 v4  
    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 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 which 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