yawning_titan.db.doc_metadata.DocMetadata#
- class yawning_titan.db.doc_metadata.DocMetadata(uuid=None, name=None, description=None, author=None, locked=False, created_at=None, updated_at=None)[source]#
Bases:
object
A secure class to hold metadata related to a document in a Yawning-Titan TinyDB file.
The
uuid
andcreated_at
attributes are set upon instantiation if they are not passed as params. Once set, they cannot be changed.The
DocMetadata
constructor.- Parameters:
uuid – The documents globally unique identifier.
name – The name given to the document by the author.
description – The description given to the document by the author.
author – The original author of the document.
locked – Whether the doc is locked for editing or not.
created_at – The datetime the document was created at as an ISO 8601 str.
updated_at – The datetime the document was last updated at as an ISO 8601 str.
Methods
Serialize the
DocMetadata
as adict
.Get the doc metadata values as a list.
Updated the name, description, and author.
Attributes
The original author of the document.
The datetime the document was created at as an ISO 8601 str.
The description given to the document by the author.
Whether the doc is locked for editing or not.
The name given to the document by the author.
The datetime the document was last updated at as an ISO 8601 str.
The documents globally unique identifier.
- property uuid#
The documents globally unique identifier.
- property created_at#
The datetime the document was created at as an ISO 8601 str.
- property locked#
Whether the doc is locked for editing or not.
- property updated_at#
The datetime the document was last updated at as an ISO 8601 str.
- property name#
The name given to the document by the author.
- property description#
The description given to the document by the author.
- property author#
The original author of the document.
- update(name=None, description=None, author=None)[source]#
Updated the name, description, and author.
- Parameters:
name – The name given to the document by the author.
description – The description given to the document by the author.
author – The original author of the document.