Encodes an object into a dictionary of fields and values.
This object is used for both JSON and XML API formats.
Projects can subclass this to provide representations of their objects.
To make use of a encoder, add the path to the encoder class to
the project’s settings.WEB_API_ENCODERS list.
This is expected to return either a dictionary or a list. If the
object being encoded is not supported, return None, or call
the superclass’s encode method.
This is expected to return either a dictionary or a list. If the
object being encoded is not supported, return None, or call
the superclass’s encode method.
This is expected to return either a dictionary or a list. If the
object being encoded is not supported, return None, or call
the superclass’s encode method.
This takes an existing encoder and makes it available to use as a
json.JSONEncoder. This is used internally when generating JSON from a
WebAPIEncoder, but can be used in other projects for more specific
purposes as well.