core.bones.boolean

Module Contents

Classes

BooleanBone

Represents a boolean data type, which can have two possible values: True or False.

class core.bones.boolean.BooleanBone(*, defaultValue: bool | List[bool] | Dict[str, List[bool] | bool] = None, **kwargs)

Bases: viur.core.bones.base.BaseBone

Represents a boolean data type, which can have two possible values: True or False.

BooleanBones cannot be defined as multiple=True.

Parameters:

defaultValue (bool) – The default value of the BooleanBone instance. Defaults to False.

Raises:

ValueError – If the defaultValue is not a boolean value (True or False).

type = 'bool'
singleValueFromClient(value, skel: viur.core.skeleton.SkeletonInstance, name: str, origData)
getEmptyValue()
isEmpty(rawValue: Any)
refresh(skel: viur.core.skeleton.SkeletonInstance, boneName: str) None

Inverse of serialize. Evaluates whats read from the datastore and populates this bone accordingly.

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: str | None = None) viur.core.db.Query