jina.types.document.mixins.version module

class jina.types.document.mixins.version.VersionedMixin[source]

Bases: object

Helper class to add versioning to an object. The version number is incremented each time an attribute is set.

version = 0
jina.types.document.mixins.version.versioned(fn)[source]

Decorator function that increases the version number each time the decorated method is called. The class of the decorated method must be a subclass of VersionedMixin :param fn: the method to decorate :return: decorated function