fix: push to

This commit is contained in:
2024-04-30 09:31:38 +02:00
parent 312e26ec44
commit 796f609d86
2 changed files with 5 additions and 10 deletions

View File

@@ -82,9 +82,9 @@ class Collection(Generic[T]):
def _find_object(self, __object: T) -> Optional[T]:
for c in self.push_to:
found = c._find_object(__object)
found, found_in = c._find_object(__object)
if found is not None:
return found, c
return found, found_in
self._remap()
@@ -92,6 +92,8 @@ class Collection(Generic[T]):
if value in self._indexed_values[name]:
return self._indexed_values[name][value], self
return None, self
def append(self, __object: Optional[T], **kwargs):
"""
If an object, that represents the same entity exists in a relevant collection,