core.bones.key

Module Contents

Classes

KeyBone

class core.bones.key.KeyBone(*, descr='Key', readOnly=True, visible=False, **kwargs)

Bases: viur.core.bones.base.BaseBone

type = key
unserialize(skel: viur.core.skeleton.SkeletonValues, name: str) bool

Inverse of serialize. Evaluates whats read from the datastore and populates this bone accordingly. :param name: The property-name this bone has in its Skeleton (not the description!)

serialize(skel: SkeletonInstance, name: str, parentIndexed: bool) bool

Serializes this bone into something we can write into the datastore.

Parameters

name – The property-name this bone has in its Skeleton (not the description!)

buildDBFilter(name: str, skel: viur.core.skeleton.SkeletonInstance, dbFilter: viur.core.db.Query, rawFilter: Dict, prefix: Optional[str] = None) viur.core.db.Query

Parses the searchfilter a client specified in his Request into something understood by the datastore. This function must:

  • Ignore all filters not targeting this bone

  • Safely handle malformed data in rawFilter

    (this parameter is directly controlled by the client)

Parameters
  • name – The property-name this bone has in its Skeleton (not the description!)

  • skel – The viur.core.db.Query this bone is part of

  • dbFilter – The current viur.core.db.Query instance the filters should be applied to

  • rawFilter – The dictionary of filters the client wants to have applied

Returns

The modified viur.core.db.Query