angelos.document.document

Module docstring.

class angelos.document.document.ChangeableMixin

Bases: angelos.document.document.UpdatedMixin

Changeable is an updatable mixin that gives provision to change the value of some fields.

changeables() → tuple

Fields that are allowed to change when updated.

class angelos.document.document.DocType

Bases: object

Short summary.

CACHED_MSG = 700
COM_ENVELOPE = 60
COM_INSTANT = 71
COM_MAIL = 72
COM_NOTE = 70
COM_REPORT = 74
COM_SHARE = 73
ENTITY_CHURCH = 22
ENTITY_MINISTRY = 21
ENTITY_PERSON = 20
KEYS = 10
KEYS_PRIVATE = 1
NET_DOMAIN = 40
NET_NETWORK = 42
NET_NODE = 41
NONE = 0
PROF_CHURCH = 32
PROF_MINISTRY = 31
PROF_PERSON = 30
STAT_REVOKED = 52
STAT_TRUSTED = 51
STAT_VERIFIED = 50
class angelos.document.document.Document(nd: dict = {}, strict: bool = True)

Bases: angelos.document.document.IssueMixin, angelos.document.model.BaseDocument

Short summary.

id

Description of attribute id.

Type

UuidField

created

Description of attribute created.

Type

DateField

expires

Description of attribute expires.

Type

DateField

compare(document: angelos.document.document.Document) → bool

Compare two documents to see if they are the same even if other fields mismatch.

expires_soon() → bool

Within a month of expiry.

Returns

Description of returned object.

Return type

type

get_owner() → uuid.UUID

Correct owner of document.

get_touched() → datetime.date

Latest touch, created or updated date.

is_expired() → bool

Is the document expired?

is_way_old() → bool

Is the document older than three years?

period() → float

The Delta period to expiry date.

Returns (datetime.timedelta):

The Delta period.

save() → bytes

Serialize document.

Returns

Stream of bytes representing the document.

Return type

bytes

validate(*args, **kwargs)

Wrapping the callable.

Parameters
  • self (class) – Method owner

  • *args – Any arguments

  • **kwargs – Any keyword arguments

Returns

The result from the callable

exception angelos.document.document.DocumentError

Bases: angelos.common.policy.PolicyException

DOCUMENT_INVALID_TYPE = ('Invalid type set', 605)
DOCUMENT_NO_HOST = ('Network document has no valid hosts', 611)
DOCUMENT_NO_LOCATION = ('Node document has no valid location set', 610)
DOCUMENT_OWNER_IS_ISSUER = ('Document owner can not be the same as issuer.', 614)
DOCUMENT_PERSON_NAMES = ('Given name not in names', 606)
DOCUMENT_SHORT_EXPIRY = ('Expiry date to short', 604)
DOCUMENT_UPDATED_NOT_LATEST = ('Document updated earlier than created', 612)
DOCUMENT_WRONG_ID = ('Document ID is not the same as Containing document.', 613)
class angelos.document.document.IssueMixin

Bases: object

Short summary.

signature

Description of attribute signature.

Type

SignatureField

issuer

Description of attribute issuer.

Type

UuidField

apply_rules() → bool

Short summary.

Returns

Description of returned object.

Return type

type

class angelos.document.document.OwnerMixin

Bases: object

Short summary.

owner

Description of attribute owner.

Type

UuidField

apply_rules() → bool

Short summary.

Returns

Description of returned object.

Return type

type

class angelos.document.document.UpdatedMixin

Bases: object

Short summary.

updated

Description of attribute updated.

Type

DateField

apply_rules() → bool

Applies all class related rules to document.

Returns

Description of returned object.

Return type

type

renew()

Short summary.

Returns

Description of returned object.

Return type

type