core.bones.uid ============== .. py:module:: core.bones.uid Classes ------- .. autoapisummary:: core.bones.uid.UidBone Functions --------- .. autoapisummary:: core.bones.uid.generate_number core.bones.uid.generate_uid Module Contents --------------- .. py:function:: generate_number(db_key) The generate_number method generates a leading number that is always unique per entry. .. py:function:: generate_uid(skel, bone) .. py:class:: UidBone(*, generate_fn = generate_uid, fillchar = '*', length = 13, pattern = '*', **kwargs) Bases: :py:obj:`viur.core.bones.base.BaseBone` The "UidBone" represents a data field that contains text values. Initializes a new UidBone. :param generate_fn: The compute function to calculate the unique value, :param fillchar The char that are filed in when the uid has not the length. :param length: The length allowed for values of this bone. :param pattern: The pattern for this Bone. "*" will be replaced with the uid value. :param kwargs: Inherited arguments from the BaseBone. .. py:attribute:: type :value: 'uid' .. py:attribute:: fillchar :value: '' .. py:attribute:: length :value: 13 .. py:attribute:: pattern :value: '' .. py:method:: structure() Describes the bone and its settings as an JSON-serializable dict. This function has to be implemented for subsequent, specialized bone types.