refactored and cleaned up data objects

This commit is contained in:
Hellow
2023-02-25 22:16:32 +01:00
parent 819111c53a
commit 5f4912bda5
7 changed files with 148 additions and 179 deletions

View File

@@ -0,0 +1,27 @@
from typing import List
import pycountry
from .parents import DatabaseObject
from .source import SourceAttribute, Source
from .metadata import MetadataAttribute
from .formatted_text import FormattedText
class Lyrics(DatabaseObject, SourceAttribute, MetadataAttribute):
def __init__(
self,
text: FormattedText,
language: pycountry.Languages,
_id: str = None,
dynamic: bool = False,
source_list: List[Source] = None,
**kwargs
) -> None:
DatabaseObject.__init__(_id=_id, dynamic=dynamic)
self.text: FormattedText = text
self.language: pycountry.Languages = language
if source_list is not None:
self.source_list = source_list