pipelines.utils module#

pipelines.utils.get_django_object(serializable_object: Dict[str, Any])#

Converts a serialized object into a django ORM object. The serializable_object must have the following keys:

  • pk: The id of the object in the database

  • app_label: The name of the django app the object belongs to

  • model_name: The name of the objects model

Parameters:

serializable_object – The json object to convert

pipelines.utils.get_object(serializable_object: Dict[str, Any])#

Converts a serialized object into a concrete python object. This will either return the original serializable_object or django model object if the serializable_object has the following keys:

  • pk: The id of the object in the database

  • app_label: The name of the django app the object belongs to

  • model_name: The name of the objects model

Parameters:

serializable_object – The json object to convert