models

Module: espressodb.base.utilities.models

get_espressodb_models([exclude_apps])

Returns all installed project models which are not in the exclude list.

iter_tree(model[, name])

Extracts all foreign keys of model and inserters them in list.


Help functions to inspect espressodb.base.models.Base models.

get_espressodb_models(exclude_apps=None)[source]

Returns all installed project models which are not in the exclude list.

Parameters

exclude_apps (Optional[Tuple[str]]) – The apps to exclude.

Return type

Model

iter_tree(model, name=None)[source]

Extracts all foreign keys of model and inserters them in list.

Returns strings in flat tree format, e.g., model_column_A.model_column_B.

Parameters
  • model (Base) – A child of the base model.

  • name (Optional[str]) – The (path) name of the model.

Return type

List[Tuple[str, str]]

Returns

First element of tuple are name names of the foreign keys in format {name}.{field.name}. Second element are the actual classes.