components.data.models

Data model

class components.data.models.Data(*args, **kwargs)

Bases: core_main_app.components.abstract_data.models.AbstractData

Data object

exception DoesNotExist

Bases: mongoengine.errors.DoesNotExist

exception MultipleObjectsReturned

Bases: mongoengine.errors.MultipleObjectsReturned

static aggregate(pipeline)

Execute an aggregate on the Data collection.

Parameters:pipeline

Returns:

static execute_query(query, order_by_field=None)

Execute a query.

Parameters:
  • query
  • order_by_field – Order by field.

Returns:

static get_all(order_by_field=None)

Get all data.

Parameters:order_by_field – Order by field.

Returns:

static get_all_by_id_list(list_id)

Return the object with the given list id.

Parameters:list_id
Returns:Object collection
static get_all_by_list_template(list_template)

Get all data that belong to the list of template.

Parameters:list_template

Returns:

static get_all_by_list_workspace(list_workspace)

Get all data that belong to the list of workspace.

Parameters:list_workspace

Returns:

static get_all_by_user_id(user_id, order_by_field=None)

Get all data relative to the given user id

Parameters:
  • user_id
  • order_by_field – Order by field.

Returns:

static get_all_by_workspace(workspace)

Get all data that belong to the workspace.

Parameters:workspace

Returns:

static get_all_except(id_list=None, order_by_field=None)

Get all data except for the ones with ID within the provided list.

Parameters:
  • id_list
  • order_by_field

Returns:

static get_all_except_user_id(user_id)

Get all data non relative to the given user id

Parameters:user_id

Returns:

static get_by_id(data_id)

Return the object with the given id.

Parameters:data_id
Returns:Data object with the given id
Return type:Data (obj)
id

A field wrapper around MongoDB’s ObjectIds.

template
user_id
workspace