Opened 9 years ago

Closed 9 years ago

#12861 closed (duplicate)

Docs lack example of how to include a custom JSONEncoder subclass into serializers.serialize()

Reported by: Oroku Saki Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: serialize, serializers
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In this section it describes an example of where you would need a custom encoder class, but gives no example of how to add your class. My guess was using serialize(obj, cls=MyCustomClass), but this raised a "multiple values of 'cls' keyword argument" error. I ended up not needing a custom class, but it might be helpful for others to see it in use.

Change History (2)

comment:1 Changed 9 years ago by Russell Keith-Magee

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:2 Changed 9 years ago by Tim Graham

Resolution: duplicate
Status: newclosed

duplicate of #15091

Note: See TracTickets for help on using tickets.
Back to Top