fix/collections #7

Merged
Hazel merged 15 commits from fix/collections into experimental 2024-04-16 11:35:48 +00:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit 3aef267608 - Show all commits

View File

@ -58,7 +58,7 @@ class Collection(Generic[T]):
self._indexed_values[name].add(value)
self._indexed_to_objects[value].append(__object)
if not from_map:
if not from_map or True:
for attribute, new_object in self.contain_given_in_attribute.items():
__object.__getattribute__(attribute).contain_collection_inside(new_object)
@ -110,7 +110,7 @@ class Collection(Generic[T]):
if self._contained_in_self(__object):
return [self]
for collection in self.children:
for collection in (*self.children, *self.parents):
results.extend(collection._contained_in_sub(__object, break_at_first=break_at_first))
if break_at_first:

View File

@ -244,6 +244,9 @@ class Album(Base):
self.song_collection.contain_attribute_in_given = {
"main_artist_collection": self.artist_collection
}
self.song_collection.append_object_to_attribute = {
"album_collection": self
}
def _add_other_db_objects(self, object_type: Type[OuterProxy], object_list: List[OuterProxy]):
if object_type is Song: