:py:mod:`core.skeleton` ======================= .. py:module:: core.skeleton Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: core.skeleton.MetaBaseSkel core.skeleton.SkeletonInstance core.skeleton.BaseSkeleton core.skeleton.MetaSkel core.skeleton.DatabaseAdapter core.skeleton.ViurTagsSearchAdapter core.skeleton.SeoKeyBone core.skeleton.Skeleton core.skeleton.RelSkel core.skeleton.RefSkel core.skeleton.SkelList core.skeleton.TaskUpdateSearchIndex core.skeleton.RebuildSearchIndex core.skeleton.TaskVacuumRelations Functions ~~~~~~~~~ .. autoapisummary:: core.skeleton.skeletonByKind core.skeleton.listKnownSkeletons core.skeleton.iterAllSkelClasses core.skeleton.remove_render_preparation_deep core.skeleton.processRemovedRelations core.skeleton.updateRelations core.skeleton.processVacuumRelationsChunk core.skeleton.__getattr__ Attributes ~~~~~~~~~~ .. autoapisummary:: core.skeleton._UNDEFINED core.skeleton.ABSTRACT_SKEL_CLS_SUFFIX core.skeleton.KeyType core.skeleton.__DEPRECATED_NAMES .. py:data:: _UNDEFINED .. py:data:: ABSTRACT_SKEL_CLS_SUFFIX :value: 'AbstractSkel' .. py:data:: KeyType :type: TypeAlias .. py:class:: MetaBaseSkel(name, bases, dct, **kwargs) Bases: :py:obj:`type` This is the metaclass for Skeletons. It is used to enforce several restrictions on bone names, etc. .. py:attribute:: _skelCache .. py:attribute:: _allSkelClasses .. py:attribute:: __reserved_keywords .. py:attribute:: __allowed_chars .. py:method:: generate_bonemap(cls) :staticmethod: Recursively constructs a dict of bones from .. py:method:: __setattr__(key, value) Implement setattr(self, name, value). .. py:class:: SkeletonInstance(skel_cls, *, bones = (), bone_map = None, clone = False, clonedBoneMap = None) The actual wrapper around a Skeleton-Class. An object of this class is what's actually returned when you call a Skeleton-Class. With ViUR3, you don't get an instance of a Skeleton-Class any more - it's always this class. This is much faster as this is a small class. Creates a new SkeletonInstance based on `skel_cls`. :param skel_cls: Is the base skeleton class to inherit from and reference to. :param bones: If given, defines an iterable of bones that are take into the SkeletonInstance. The order of the bones defines the order in the SkeletonInstance. :param bone_map: A pre-defined bone map to use, or extend. :param clone: If set True, performs a cloning of the used bone map, to be entirely stand-alone. .. py:attribute:: __slots__ .. py:method:: items(yieldBoneValues = False) .. py:method:: keys() .. py:method:: values() .. py:method:: __iter__() .. py:method:: __contains__(item) .. py:method:: get(item, default=None) .. py:method:: update(*args, **kwargs) .. py:method:: __setitem__(key, value) .. py:method:: __getitem__(key) .. py:method:: __getattr__(item) Get a special attribute from the SkeletonInstance __getattr__ is called when an attribute access fails with an AttributeError. So we know that this is not a real attribute of the SkeletonInstance. But there are still a few special cases in which attributes are loaded from the skeleton class. .. py:method:: __delattr__(item) Implement delattr(self, name). .. py:method:: __setattr__(key, value) Implement setattr(self, name, value). .. py:method:: __repr__() Return repr(self). .. py:method:: __str__() Return str(self). .. py:method:: __len__() .. py:method:: __ior__(other) .. py:method:: clone(*, apply_clone_strategy = False) Clones a SkeletonInstance into a modificable, stand-alone instance. This will also allow to modify the underlying data model. .. py:method:: ensure_is_cloned() Ensured this SkeletonInstance is a stand-alone clone, which can be modified. Does nothing in case it was already cloned before. .. py:method:: setEntity(entity) .. py:method:: structure() .. py:method:: __deepcopy__(memodict) .. py:class:: BaseSkeleton Bases: :py:obj:`object` This is a container-object holding information about one database entity. It has to be sub-classed with individual information about the kindName of the entities and its specific data attributes, the so called bones. The Skeleton stores its bones in an :class:`OrderedDict`-Instance, so the definition order of the contained bones remains constant. :ivar key: This bone stores the current database key of this entity. Assigning to this bones value is dangerous and does *not* affect the actual key its stored in. :vartype key: server.bones.BaseBone :ivar creationdate: The date and time where this entity has been created. :vartype creationdate: server.bones.DateBone :ivar changedate: The date and time of the last change to this entity. :vartype changedate: server.bones.DateBone .. py:attribute:: __viurBaseSkeletonMarker__ :value: True .. py:attribute:: boneMap .. py:method:: subSkel(*subskel_names, fullClone = False, **kwargs) :classmethod: .. py:method:: subskel(*names, bones = (), clone = False) :classmethod: Creates a new sub-skeleton from the current skeleton. A sub-skeleton is a copy of the original skeleton, containing only a subset of its bones. Sub-skeletons can either be defined using the the subSkels property of the Skeleton object, or freely by giving patterns for bone names which shall be part of the sub-skeleton. 1. Giving names as parameter merges the bones of all Skeleton.subSkels-configurations together. This is the usual behavior. By passing multiple sub-skeleton names to this function, a sub-skeleton with the union of all bones of the specified sub-skeletons is returned. If an entry called "*" exists in the subSkels-dictionary, the bones listed in this entry will always be part of the generated sub-skeleton. 2. Given the *bones* parameter allows to freely specify a sub-skeleton; One specialty here is, that the order of the bones can also be changed in this mode. This mode is the new way of defining sub-skeletons, and might become the primary way to define sub-skeletons in future. 3. Both modes (1 + 2) can be combined, but then the original order of the bones is kept. 4. The "key" bone is automatically available in each sub-skeleton. 5. An fnmatch-compatible wildcard pattern is allowed both in the subSkels-bone-list and the free bone list. Example (TodoSkel is the example skeleton from viur-base): ```py # legacy mode (see 1) subskel = TodoSkel.subskel("add") # creates subskel: key, firstname, lastname, subject # free mode (see 2) allows to specify a different order! subskel = TodoSkel.subskel(bones=("subject", "message", "*stname")) # creates subskel: key, subject, message, firstname, lastname # mixed mode (see 3) subskel = TodoSkel.subskel("add", bones=("message", )) # creates subskel: key, firstname, lastname, subject, message ``` :param bones: Allows to specify an iterator of bone names (more precisely, fnmatch-wildards) which allow to freely define a subskel. If *only* this parameter is given, the order of the specification also defines, the order of the list. Otherwise, the original order as defined in the skeleton is kept. :param clone: If set True, performs a cloning of the used bone map, to be entirely stand-alone. :return: The sub-skeleton of the specified type. .. py:method:: setSystemInitialized() :classmethod: .. py:method:: setBoneValue(skel, boneName, value, append = False, language = None) :classmethod: Allows for setting a bones value without calling fromClient or assigning a value directly. Sanity-Checks are performed; if the value is invalid, that bone flips back to its original (default) value and false is returned. :param boneName: The name of the bone to be modified :param value: The value that should be assigned. It's type depends on the type of that bone :param append: If True, the given value is appended to the values of that bone instead of replacing it. Only supported on bones with multiple=True :param language: Language to set :return: Wherever that operation succeeded or not. .. py:method:: fromClient(skel, data, *, amend = False, ignore = None) :classmethod: Load supplied *data* into Skeleton. This function works similar to :func:`~viur.core.skeleton.Skeleton.setValues`, except that the values retrieved from *data* are checked against the bones and their validity checks. Even if this function returns False, all bones are guaranteed to be in a valid state. The ones which have been read correctly are set to their valid values; Bones with invalid values are set back to a safe default (None in most cases). So its possible to call :func:`~viur.core.skeleton.Skeleton.write` afterwards even if reading data with this function failed (through this might violates the assumed consistency-model). :param skel: The skeleton instance to be filled. :param data: Dictionary from which the data is read. :param amend: Defines whether content of data may be incomplete to amend the skel, which is useful for edit-actions. :param ignore: optional list of bones to be ignored; Defaults to all readonly-bones when set to None. :returns: True if all data was successfully read and complete. False otherwise (e.g. some required fields where missing or where invalid). .. py:method:: refresh(skel) :classmethod: Refresh the bones current content. This function causes a refresh of all relational bones and their associated information. .. py:class:: MetaSkel(name, bases, dct, **kwargs) Bases: :py:obj:`MetaBaseSkel` This is the metaclass for Skeletons. It is used to enforce several restrictions on bone names, etc. .. py:class:: DatabaseAdapter Adapter class used to bind or use other databases and hook operations when working with a Skeleton. .. py:attribute:: providesFulltextSearch :type: bool :value: False Set to True if we can run a fulltext search using this database. .. py:attribute:: fulltextSearchGuaranteesQueryConstrains :value: False Are results returned by `meth:fulltextSearch` guaranteed to also match the databaseQuery .. py:attribute:: providesCustomQueries :type: bool :value: False Indicate that we can run more types of queries than originally supported by datastore .. py:method:: prewrite(skel, is_add, change_list = ()) Hook being called on a add, edit or delete operation before the skeleton-specific action is performed. The hook can be used to modifiy the skeleton before writing. The raw entity can be obainted using `skel.dbEntity`. :param action: Either contains "add", "edit" or "delete", depending on the operation. :param skel: is the skeleton that is being read before written. :param change_list: is a list of bone names which are being changed within the write. .. py:method:: write(skel, is_add, change_list = ()) Hook being called on a write operations after the skeleton is written. The raw entity can be obainted using `skel.dbEntity`. :param action: Either contains "add" or "edit", depending on the operation. :param skel: is the skeleton that is being read before written. :param change_list: is a list of bone names which are being changed within the write. .. py:method:: delete(skel) Hook being called on a delete operation after the skeleton is deleted. .. py:method:: fulltextSearch(queryString, databaseQuery) :abstractmethod: If this database supports fulltext searches, this method has to implement them. If it's a plain fulltext search engine, leave 'prop:fulltextSearchGuaranteesQueryConstrains' set to False, then the server will post-process the list of entries returned from this function and drop any entry that cannot be returned due to other constrains set in 'param:databaseQuery'. If you can obey *every* constrain set in that Query, we can skip this post-processing and save some CPU-cycles. :param queryString: the string as received from the user (no quotation or other safety checks applied!) :param databaseQuery: The query containing any constrains that returned entries must also match :return: .. py:class:: ViurTagsSearchAdapter(min_length = 2, max_length = 50, substring_matching = False) Bases: :py:obj:`DatabaseAdapter` This Adapter implements a simple fulltext search on top of the datastore. On skel.write(), all words from String-/TextBones are collected with all *min_length* postfixes and dumped into the property `viurTags`. When queried, we'll run a prefix-match against this property - thus returning entities with either an exact match or a match within a word. Example: For the word "hello" we'll write "hello", "ello" and "llo" into viurTags. When queried with "hello" we'll have an exact match. When queried with "hel" we'll match the prefix for "hello" When queried with "ell" we'll prefix-match "ello" - this is only enabled when substring_matching is True. We'll automatically add this adapter if a skeleton has no other database adapter defined. .. py:attribute:: providesFulltextSearch :value: True .. py:attribute:: fulltextSearchGuaranteesQueryConstrains :value: True .. py:method:: _tags_from_str(value) Extract all words including all min_length postfixes from given string .. py:method:: prewrite(skel, *args, **kwargs) Collect searchTags from skeleton and build viurTags .. py:method:: fulltextSearch(queryString, databaseQuery) Run a fulltext search .. py:class:: SeoKeyBone(*, caseSensitive = True, max_length = 254, min_length = None, natural_sorting = False, escape_html = True, **kwargs) Bases: :py:obj:`viur.core.bones.StringBone` Special kind of StringBone saving its contents as `viurCurrentSeoKeys` into the entity's `viur` dict. Initializes a new StringBone. :param caseSensitive: When filtering for values in this bone, should it be case-sensitive? :param max_length: The maximum length allowed for values of this bone. Set to None for no limitation. :param min_length: The minimum length allowed for values of this bone. Set to None for no limitation. :param natural_sorting: Allows a more natural sorting than the default sorting on the plain values. This uses the .sort_idx property. `True` enables sorting according to DIN 5007 Variant 2. With passing a `callable`, a custom transformer method can be set that creates the value for the index property. :param escape_html: Replace some characters in the string with HTML-safe sequences with using :meth:`utils.string.escape` for safe use in HTML. :param kwargs: Inherited arguments from the BaseBone. .. py:method:: unserialize(skel, name) Deserialize bone data from the datastore and populate the bone with the deserialized values. This function is the inverse of the serialize function. It converts data from the datastore into a format that can be used by the bones in the skeleton. :param skel: A SkeletonInstance object containing the values to be deserialized. :param name: The property name of the bone in its Skeleton (not the description). :returns: True if deserialization is successful, False otherwise. .. py:method:: serialize(skel, name, parentIndexed) Serializes this bone into a format that can be written into the datastore. :param skel: A SkeletonInstance object containing the values to be serialized. :param name: A string representing the property name of the bone in its Skeleton (not the description). :param parentIndexed: A boolean indicating whether the parent bone is indexed. :return: A boolean indicating whether the serialization was successful. .. py:class:: Skeleton(*args, **kwargs) Bases: :py:obj:`BaseSkeleton` This is a container-object holding information about one database entity. It has to be sub-classed with individual information about the kindName of the entities and its specific data attributes, the so called bones. The Skeleton stores its bones in an :class:`OrderedDict`-Instance, so the definition order of the contained bones remains constant. :ivar key: This bone stores the current database key of this entity. Assigning to this bones value is dangerous and does *not* affect the actual key its stored in. :vartype key: server.bones.BaseBone :ivar creationdate: The date and time where this entity has been created. :vartype creationdate: server.bones.DateBone :ivar changedate: The date and time of the last change to this entity. :vartype changedate: server.bones.DateBone .. py:attribute:: kindName :type: str Specifies the entity kind name this Skeleton is associated with. Will be determined automatically when not explicitly set. .. py:attribute:: database_adapters :type: DatabaseAdapter | Iterable[DatabaseAdapter] | None Custom database adapters. Allows to hook special functionalities that during skeleton modifications. .. py:attribute:: subSkels .. py:attribute:: interBoneValidations :type: list[Callable[[Skeleton], list[viur.core.bones.base.ReadFromClientError]]] :value: [] .. py:attribute:: __seo_key_trans .. py:attribute:: key .. py:attribute:: name .. py:attribute:: creationdate .. py:attribute:: changedate .. py:attribute:: viurCurrentSeoKeys .. py:method:: __repr__() Return repr(self). .. py:method:: __str__() Return str(self). .. py:method:: all(skel, **kwargs) :classmethod: Create a query with the current Skeletons kindName. :returns: A db.Query object which allows for entity filtering and sorting. .. py:method:: fromClient(skel, data, *, amend = False, ignore = None) :classmethod: This function works similar to :func:`~viur.core.skeleton.Skeleton.setValues`, except that the values retrieved from *data* are checked against the bones and their validity checks. Even if this function returns False, all bones are guaranteed to be in a valid state. The ones which have been read correctly are set to their valid values; Bones with invalid values are set back to a safe default (None in most cases). So its possible to call :func:`~viur.core.skeleton.Skeleton.write` afterwards even if reading data with this function failed (through this might violates the assumed consistency-model). :param skel: The skeleton instance to be filled. :param data: Dictionary from which the data is read. :param amend: Defines whether content of data may be incomplete to amend the skel, which is useful for edit-actions. :param ignore: optional list of bones to be ignored; Defaults to all readonly-bones when set to None. :returns: True if all data was successfully read and complete. False otherwise (e.g. some required fields where missing or where invalid). .. py:method:: fromDB(skel, key) :classmethod: Deprecated function, replaced by Skeleton.read(). .. py:method:: read(skel, key = None, *, create = False, _check_legacy = True) :classmethod: Read Skeleton with *key* from the datastore into the Skeleton. If not key is given, skel["key"] will be used. Reads all available data of entity kind *kindName* and the key *key* from the Datastore into the Skeleton structure's bones. Any previous data of the bones will discard. To store a Skeleton object to the Datastore, see :func:`~viur.core.skeleton.Skeleton.write`. :param key: A :class:`viur.core.db.Key`, string, or int; from which the data shall be fetched. If not provided, skel["key"] will be used. :param create: Allows to specify a dict or initial callable that is executed in case the Skeleton with the given key does not exist, it will be created. :returns: None on error, or the given SkeletonInstance on success. .. py:method:: toDB(skel, update_relations = True, **kwargs) :classmethod: Deprecated function, replaced by Skeleton.write(). .. py:method:: write(skel, key = None, *, update_relations = True, _check_legacy = True) :classmethod: Write current Skeleton to the datastore. Stores the current data of this instance into the database. If an *key* value is set to the object, this entity will ne updated; Otherwise a new entity will be created. To read a Skeleton object from the data store, see :func:`~viur.core.skeleton.Skeleton.read`. :param key: Allows to specify a key that is set to the skeleton and used for writing. :param update_relations: If False, this entity won't be marked dirty; This avoids from being fetched by the background task updating relations. :returns: The Skeleton. .. py:method:: delete(skel, key = None) :classmethod: Deletes the entity associated with the current Skeleton from the data store. :param key: Allows to specify a key that is used for deletion, otherwise skel["key"] will be used. .. py:method:: patch(skel, values = {}, *, key = None, check = None, create = None, update_relations = True, ignore = (), retry = 0) :classmethod: Performs an edit operation on a Skeleton within a transaction. The transaction performs a read, sets bones and afterwards does a write with exclusive access on the given Skeleton and its underlying database entity. All value-dicts that are being fed to this function are provided to `skel.fromClient()`. Instead of dicts, a callable can also be given that can individually modify the Skeleton that is edited. :param values: A dict of key-values to update on the entry, or a callable that is executed within the transaction. This dict allows for a special notation: Keys starting with "+" or "-" are added or substracted to the given value, which can be used for counters. :param key: A :class:`viur.core.db.Key`, string, or int; from which the data shall be fetched. If not provided, skel["key"] will be used. :param check: An optional dict of key-values or a callable to check on the Skeleton before updating. If something fails within this check, an AssertionError is being raised. :param create: Allows to specify a dict or initial callable that is executed in case the Skeleton with the given key does not exist. :param update_relations: Trigger update relations task on success. Defaults to False. :param trust: Use internal `fromClient` with trusted data (may change readonly-bones) :param retry: On ViurDatastoreError, retry for this amount of times. If the function does not raise an Exception, all went well. The function always returns the input Skeleton. Raises: ValueError: In case parameters where given wrong or incomplete. AssertionError: In case an asserted check parameter did not match. ReadFromClientException: In case a skel.fromClient() failed with a high severity. .. py:method:: preProcessBlobLocks(skel, locks) :classmethod: Can be overridden to modify the list of blobs referenced by this skeleton .. py:method:: preProcessSerializedData(skel, entity) :classmethod: Can be overridden to modify the :class:`viur.core.db.Entity` before its actually written to the data store. .. py:method:: postSavedHandler(skel, key, dbObj) :classmethod: Can be overridden to perform further actions after the entity has been written to the data store. .. py:method:: postDeletedHandler(skel, key) :classmethod: Can be overridden to perform further actions after the entity has been deleted from the data store. .. py:method:: getCurrentSEOKeys(skel) :classmethod: Should be overridden to return a dictionary of language -> SEO-Friendly key this entry should be reachable under. How theses names are derived are entirely up to the application. If the name is already in use for this module, the server will automatically append some random string to make it unique. :return: .. py:class:: RelSkel Bases: :py:obj:`BaseSkeleton` This is a Skeleton-like class that acts as a container for Skeletons used as a additional information data skeleton for :class:`~viur.core.bones.extendedRelationalBone.extendedRelationalBone`. It needs to be sub-classed where information about the kindName and its attributes (bones) are specified. The Skeleton stores its bones in an :class:`OrderedDict`-Instance, so the definition order of the contained bones remains constant. .. py:method:: serialize(parentIndexed) .. py:method:: unserialize(values) Loads 'values' into this skeleton. :param values: dict with values we'll assign to our bones .. py:class:: RefSkel Bases: :py:obj:`RelSkel` This is a Skeleton-like class that acts as a container for Skeletons used as a additional information data skeleton for :class:`~viur.core.bones.extendedRelationalBone.extendedRelationalBone`. It needs to be sub-classed where information about the kindName and its attributes (bones) are specified. The Skeleton stores its bones in an :class:`OrderedDict`-Instance, so the definition order of the contained bones remains constant. .. py:method:: fromSkel(kindName, *args) :classmethod: Creates a ``RefSkel`` from a skeleton-class using only the bones explicitly named in ``args``. :param args: List of bone names we'll adapt :return: A new instance of RefSkel .. py:method:: read(key = None) Read full skeleton instance referenced by the RefSkel from the database. Can be used for reading the full Skeleton from a RefSkel. The `key` parameter also allows to read another, given key from the related kind. :raise ValueError: If the entry is no longer in the database. .. py:class:: SkelList(baseSkel=None) Bases: :py:obj:`list` This class is used to hold multiple skeletons together with other, commonly used information. SkelLists are returned by Skel().all()...fetch()-constructs and provide additional information about the data base query, for fetching additional entries. :ivar cursor: Holds the cursor within a query. :vartype cursor: str :param baseSkel: The baseclass for all entries in this list .. py:attribute:: __slots__ :value: ('baseSkel', 'customQueryInfo', 'getCursor', 'get_orders', 'renderPreparation') .. py:function:: skeletonByKind(kindName) Returns the Skeleton-Class for the given kindName. That skeleton must exist, otherwise an exception is raised. :param kindName: The kindname to retreive the skeleton for :return: The skeleton-class for that kind .. py:function:: listKnownSkeletons() :return: A list of all known kindnames (all kindnames for which a skeleton is defined) .. py:function:: iterAllSkelClasses() :return: An iterator that yields each Skeleton-Class once. (Only top-level skeletons are returned, so no RefSkel classes will be included) .. py:function:: remove_render_preparation_deep(skel) Remove renderPreparation of nested skeletons _refSkelCache can have renderPreparation too. .. py:function:: processRemovedRelations(removedKey, cursor=None) .. py:function:: updateRelations(destKey, minChangeTime, changedBone, cursor = None) This function updates Entities, which may have a copy of values from another entity which has been recently edited (updated). In ViUR, relations are implemented by copying the values from the referenced entity into the entity that's referencing them. This allows ViUR to run queries over properties of referenced entities and prevents additional db.Get's to these referenced entities if the main entity is read. However, this forces us to track changes made to entities as we might have to update these mirrored values. This is the deferred call from meth:`viur.core.skeleton.Skeleton.write()` after an update (edit) on one Entity to do exactly that. :param destKey: The database-key of the entity that has been edited :param minChangeTime: The timestamp on which the edit occurred. As we run deferred, and the entity might have been edited multiple times before we get acutally called, we can ignore entities that have been updated in the meantime as they're already up2date :param changedBone: If set, we'll update only entites that have a copy of that bone. Relations mirror only key and name by default, so we don't have to update these if only another bone has been changed. :param cursor: The database cursor for the current request as we only process five entities at once and then defer again. .. py:class:: TaskUpdateSearchIndex Bases: :py:obj:`viur.core.tasks.CallableTaskBase` This tasks loads and saves *every* entity of the given module. This ensures an updated searchIndex and verifies consistency of this data. .. py:attribute:: key :value: 'rebuildSearchIndex' .. py:attribute:: name :value: 'Rebuild search index' .. py:attribute:: descr :value: 'This task can be called to update search indexes and relational information.' .. py:method:: canCall() Checks wherever the current user can execute this task .. py:method:: dataSkel() If additional data is needed, return a skeleton-instance here. These values are then passed to *execute*. .. py:method:: execute(module, *args, **kwargs) The actual code that should be run goes here. .. py:method:: _run(module, notify) :staticmethod: .. py:class:: RebuildSearchIndex Bases: :py:obj:`viur.core.tasks.QueryIter` BaseClass to run a database Query and process each entry matched. This will run each step deferred, so it is possible to process an arbitrary number of entries without being limited by time or memory. To use this class create a subclass, override the classmethods handleEntry and handleFinish and then call startIterOnQuery with an instance of a database Query (and possible some custom data to pass along) .. py:method:: handleEntry(skel, customData) :classmethod: Overridable hook to process one entry. "entry" will be either an db.Entity or an SkeletonInstance (if that query has been created by skel.all()) Warning: If your query has an sortOrder other than __key__ and you modify that property here it is possible to encounter that object later one *again* (as it may jump behind the current cursor). .. py:method:: handleError(skel, customData, exception) :classmethod: Handle a error occurred in handleEntry. If this function returns True, the queryIter continues, otherwise it breaks and prints the current cursor. .. py:method:: handleFinish(totalCount, customData) :classmethod: Overridable hook that indicates the current run has been finished. .. py:class:: TaskVacuumRelations Bases: :py:obj:`TaskUpdateSearchIndex` Checks entries in viur-relations and verifies that the src-kind and it's RelationalBone still exists. .. py:attribute:: key :value: 'vacuumRelations' .. py:attribute:: name :value: 'Vacuum viur-relations (dangerous)' .. py:attribute:: descr :value: 'Drop stale inbound relations for the given kind' .. py:method:: execute(module, *args, **kwargs) The actual code that should be run goes here. .. py:function:: processVacuumRelationsChunk(module, cursor, count_total = 0, count_removed = 0, notify=None) Processes 25 Entries and calls the next batch .. py:data:: __DEPRECATED_NAMES .. py:function:: __getattr__(attr)