core.bones.raw

Module Contents

Classes

RawBone

Stores its data without applying any pre/post-processing or filtering. Can be used to store

class core.bones.raw.RawBone(*, compute=None, defaultValue=None, descr='', getEmptyValueFunc=None, indexed=True, isEmptyFunc=None, languages=None, multiple=False, params=None, readOnly=None, required=False, searchable=False, type_suffix='', unique=None, vfunc=None, visible=True)

Bases: viur.core.bones.base.BaseBone

Stores its data without applying any pre/post-processing or filtering. Can be used to store non-html content. Use the dot-notation like “raw.markdown” or similar to describe subsequent types.

..Warning: Using this bone will lead to security vulnerabilities like reflected XSS unless the

data is either otherwise validated/stripped or from a trusted source! Don’t use this unless you fully understand it’s implications!

Initializes a new Bone.

Parameters:
  • compute (Compute) –

  • defaultValue (Any) –

  • descr (str | viur.core.i18n.translate) –

  • getEmptyValueFunc (callable) –

  • indexed (bool) –

  • isEmptyFunc (callable) –

  • languages (None | list[str]) –

  • multiple (bool | MultipleConstraints) –

  • params (dict) –

  • readOnly (bool) –

  • required (bool | list[str] | tuple[str]) –

  • searchable (bool) –

  • type_suffix (str) –

  • unique (None | UniqueValue) –

  • vfunc (callable) –

  • visible (bool) –

type = 'raw'
singleValueFromClient(value, skel, bone_name, client_data)

Load a single value from a client

Parameters:
  • value – The single value which should be loaded.

  • skel – The SkeletonInstance where the value should be loaded into.

  • bone_name – The bone name of this bone in the SkeletonInstance.

  • client_data – The data taken from the client, a dictionary with usually bone names as key

Returns:

A tuple. If the value is valid, the first element is the parsed value and the second is None. If the value is invalid or not parseable, the first element is a empty value and the second a list of ReadFromClientError.