This commit is contained in:
Hellow2
2023-05-25 09:21:37 +02:00
parent a1650d560c
commit 82a95f9b49
3 changed files with 53 additions and 6 deletions

View File

@@ -14,6 +14,7 @@ class DatabaseObject:
# contains all collection attributes, which describe something "smaller"
# e.g. album has songs, but not artist.
DOWNWARDS_COLLECTION_ATTRIBUTES: tuple = tuple()
UPWARDS_COLLECTION_ATTRIBUTES: tuple = tuple()
def __init__(self, _id: int = None, dynamic: bool = False, **kwargs) -> None:
self.automatic_id: bool = False

View File

@@ -46,6 +46,8 @@ class Song(MainObject):
"genre": None,
"notes": FormattedText()
}
UPWARDS_COLLECTION_ATTRIBUTES = ("album_collection", "main_artist_collection", "feature_artist_collection")
def __init__(
self,
@@ -204,7 +206,8 @@ class Album(MainObject):
"notes": FormattedText()
}
DOWNWARDS_COLLECTION_ATTRIBUTES = ("song_collection",)
DOWNWARDS_COLLECTION_ATTRIBUTES = ("song_collection", )
UPWARDS_COLLECTION_ATTRIBUTES = ("artist_collection", "label_collection")
def __init__(
self,
@@ -425,6 +428,7 @@ class Artist(MainObject):
}
DOWNWARDS_COLLECTION_ATTRIBUTES = ("feature_song_collection", "main_album_collection")
UPWARDS_COLLECTION_ATTRIBUTES = ("label_collection", )
def __init__(
self,