core.bones.address

Attributes

CACHE_KIND

Classes

AddressRelSkel

AddressBone

The RecordBone class is a specialized bone type used to store structured data. It inherits from

Module Contents

core.bones.address.CACHE_KIND = 'viur-addressbone-geocache'
class core.bones.address.AddressRelSkel

Bases: core.skeleton.relskel.RelSkel

street_name
street_number
address_addition
zip_code
city
country
coordinates
class core.bones.address.AddressBone(*, using=AddressRelSkel, format='$(street_name) $(street_number), $(zip_code) $(city)', **kwargs)

Bases: core.bones.record.RecordBone

The RecordBone class is a specialized bone type used to store structured data. It inherits from the BaseBone class. The RecordBone class is designed to store complex data structures, such as nested dictionaries or objects, by using a related skeleton class (the using parameter) to manage the internal structure of the data.

Parameters:
  • format (str) – Optional string parameter to specify the format of the record bone.

  • indexed – Optional boolean parameter to indicate if the record bone is indexed. Defaults to False.

  • using (Type[core.skeleton.relskel.RelSkel]) – A class that inherits from ‘viur.core.skeleton.RelSkel’ to be used with the RecordBone.

  • kwargs – Additional keyword arguments to be passed to the BaseBone constructor.

Initializes a new Bone.

type = 'record.address'
after_from_client(skel, name, errors)

Called at the end of fromClient() after skel[name] has been set and all validation (including multiple-constraints) has run.

Override to post-process or normalize skel[name] in-place, or to add/remove entries from errors. Always called when the field was part of the submitted data (i.e. skel[name] has been written), regardless of whether errors occurred. The NotSet early-return (field absent from request) is the only case where this hook is not called.

Parameters:
  • skel – The skeleton instance whose bone value was just read.

  • name – The attribute name of this bone within the skeleton.

  • errors – Mutable list of ReadFromClientError collected so far. Changes here affect the return value of fromClient().

static _cache_key(params)
Parameters:

params (str)

Return type:

core.db.Key

static geocode(skel)
Parameters:

skel (core.skeleton.relskel.RelSkel)

Return type:

tuple[float, float] | None