dbbase.model.Model.deserialize

classmethod Model.deserialize(data, from_camel_case=True, only_columns=False)[source]

Convert back to column names that are more pythonic.

Note that this function does not update the model object. That is left to another function that can validate the data prior to posting.

Default:

deserialize(data, from_camel_case=True, only_columns=False)

Parameters
  • data – (bytes : str : dict) : JSON string that is to be converted back to a dict. data can also be a dict or list that simply needs to have the keys converted to snake_case.

  • from_camel_case – (bool) : True will cause the keys to be converted back to snake_case.

  • only_columns – (bool) : True will cause the keys that are not columns to be stripped out.

Returns

data (obj) – the converted data