models.Context

class Context(json, **kwargs)[source]

A virtual object representing a KE-chain Context.

New in version 3.12.

Construct a service from provided json data.

classmethod list(client: Client, **kwargs) List[Context][source]

List Context objects.

classmethod get(client: Client, **kwargs) Context[source]

Retrieve a single Context object.

edit(name: ~typing.Optional[~typing.Union[str, ~pykechain.utils.Empty]] = <pykechain.utils.Empty object>, description: ~typing.Optional[~typing.Union[str, ~pykechain.utils.Empty]] = <pykechain.utils.Empty object>, tags: ~typing.Optional[~typing.List[~typing.Union[str, ~pykechain.utils.Empty]]] = <pykechain.utils.Empty object>, context_group: ~typing.Optional[~typing.Union[~pykechain.enums.ContextGroup, ~pykechain.utils.Empty]] = <pykechain.utils.Empty object>, scope: ~typing.Optional[~typing.Union[Scope, str, ~uuid.UUID]] = <pykechain.utils.Empty object>, options: ~typing.Optional[dict] = <pykechain.utils.Empty object>, activities: ~typing.Optional[~typing.Union[~typing.List[Activity], ~typing.Iterable[~typing.Union[str, ~uuid.UUID]], ~typing.KeysView]] = <pykechain.utils.Empty object>, feature_collection: ~typing.Optional[dict] = <pykechain.utils.Empty object>, start_date: ~typing.Optional[~datetime.datetime] = <pykechain.utils.Empty object>, due_date: ~typing.Optional[~datetime.datetime] = <pykechain.utils.Empty object>, **kwargs) Context[source]

Edit the Context.

Parameters
  • name – Name of the Context to be displayed to the end-user.

  • scope – Scope object or Scope Id where the Context is active on.

  • description – (optional) description of the Context

  • activities – (optional) associated list of Activity or activity object ID

  • tags – (optional) tags

  • context_group – (optional) a context context_group of the choices of ContextGroup

  • options – (optional) dictionary with options.

  • feature_collection – (optional) dict with a geojson feature collection to store for a STATIC_LOCATION

  • start_date – (optional) start datetime for a TIME_PERIOD context

  • due_date – (optional) start datetime for a TIME_PERIOD context

Returns

a created Context Object

Returns

The updated Context object

Link a context to one or more activities.

Parameters

activities – optional list of Activities or object Id’s from activities.

Returns

updated context objects

Unlink a context to one or more activities.

Parameters

activities – optional list of Activities or object Id’s from activities.

Returns

updated context objects

delete()[source]

Delete the Context.