core.skeleton.relskel

Classes

RelSkel

This is a Skeleton-like class that acts as a container for Skeletons used as a

RefSkel

This is a Skeleton-like class that acts as a container for Skeletons used as a

Module Contents

class core.skeleton.relskel.RelSkel

Bases: core.skeleton.meta.BaseSkeleton

This is a Skeleton-like class that acts as a container for Skeletons used as a additional information data skeleton for RelationalBone.

It needs to be sub-classed where information about the kindName and its attributes (bones) are specified.

The Skeleton stores its bones in an OrderedDict-Instance, so the definition order of the contained bones remains constant.

serialize(parentIndexed)
unserialize(values)

Loads ‘values’ into this skeleton.

Parameters:

values (core.db.Entity | dict) – dict with values we’ll assign to our bones

class core.skeleton.relskel.RefSkel

Bases: RelSkel

This is a Skeleton-like class that acts as a container for Skeletons used as a additional information data skeleton for RelationalBone.

It needs to be sub-classed where information about the kindName and its attributes (bones) are specified.

The Skeleton stores its bones in an OrderedDict-Instance, so the definition order of the contained bones remains constant.

skeletonCls: Type[core.skeleton.Skeleton] | None = None

Reference source skeleton class

classmethod fromSkel(kindName, *args)

Creates a RefSkel from a skeleton-class using only the bones explicitly named in args.

Parameters:
  • args (list[str]) – List of bone names we’ll adapt

  • kindName (str)

Returns:

A new instance of RefSkel

Return type:

Type[RefSkel]

read(key=None, *, subskel=(), bones=())

Read full skeleton instance referenced by the RefSkel from the database.

Can be used for reading the full Skeleton from a RefSkel. The key parameter also allows to read another, given key from the related kind.

Parameters:
  • key (Optional[core.db.Key | str | int]) – Can be used to overwrite the key; Ohterwise, the RefSkel’s key-property will be used.

  • subskel (Iterable[str]) – Optionally form skel from subskels

  • bones (Iterable[str]) – Optionally create skeleton only from the specified bones

Raises:

ValueError – If the entry is no longer in the database.

Return type:

SkeletonInstance