core.bones.dateBone

Module Contents

Classes

dateBone

Functions

datetimeToTimestamp(datetimeObj: datetime.datetime) → int

Converts this DateTime-Object back into Unixtime

core.bones.dateBone.pytz
core.bones.dateBone.datetimeToTimestamp(datetimeObj: datetime.datetime)int

Converts this DateTime-Object back into Unixtime

class core.bones.dateBone.dateBone(creationMagic=False, updateMagic=False, date=True, time=True, localize=False, *args, **kwargs)

Bases: viur.core.bones.baseBone

type = date
static generageSearchWidget(target, name='DATE BONE', mode='range')
singleValueFromClient(self, value, skel, name, origData)

Reads a value from the client. If this value is valid for this bone, store this value and return None. Otherwise our previous value is left unchanged and an error-message is returned.

Parameters
  • name (str) – Our name in the skeleton

  • data (dict) – User-supplied request-data

Returns

str or None

isInvalid(self, value)

Ensure that year is >= 1900 Otherwise strftime will break later on.

guessTimeZone(self)

Guess the timezone the user is supposed to be in. If it cant be guessed, a safe default (UTC) is used

singleValueSerialize(self, value, skel: SkeletonInstance, name: str, parentIndexed: bool)
singleValueUnserialize(self, value, skel: viur.core.skeleton.SkeletonInstance, name: str)
buildDBFilter(self, name, skel, dbFilter, rawFilter, prefix=None)
performMagic(self, valuesCache, name, isAdd)