Add the content_length field to the Document base class

This commit is contained in:
2022-05-06 17:21:39 +02:00
parent b9d0221e95
commit e8bc0cfd38
3 changed files with 17 additions and 0 deletions

View File

@@ -221,6 +221,10 @@ class Es4Document(Document): # pylint: disable=too-many-instance-attributes
self._content = value
self._content_hash = self.hash_value(value)
@property
def content_length(self) -> int:
return len(self._content)
def generate_hash(self) -> str:
"""Calculate the hash of the document