dbbase.model.Model.serialize

Model.serialize(to_camel_case=True, level_limits=None, sort=False, indent=None, serial_fields=None, serial_field_relations=None)[source]

Output JSON formatted model.

Default:
serialize(

to_camel_case=True, level_limits=None, sort=False, indent=None, serial_fields=None, serial_field_relations=None

)

Parameters
  • to_camel_case (boolean) –

  • level_limits – (dict : None) : This is more of a technical parameter that is used to limit recursion, but if a class name is listed in the dict, to_dict will not process that class.

  • sort – (bool) : This flag determines whether the keys will be sorted.

  • indent – (integer : None) The number of spaces to indent to improve readability.

  • serial_fields (None | list) – a list of fields to be substituted for cls.SERIAL_FIELDS

  • serial_field_relations (None | dict) – To enable a more nuanced control of relations objects, the name of a downstream class and a list of fields to be typically included with the related object.

return

JSON formatted string of the data.