Skip to content

Commit

Permalink
implement _HasManyProxy.__len__
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Aug 9, 2024
1 parent 692e6c5 commit 69ed256
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bfabric/entities/core/has_many.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def _load_all(self) -> None:
if not self._items and self._ids:
self._items = self._entity_type.find_all(ids=self._ids, client=self._client)

def __len__(self) -> int:
return len(self._ids)

def __repr__(self) -> str:
return f"{self.__class__.__name__}({self._entity_type}, {self._ids}, {self._client})"

Expand Down

0 comments on commit 69ed256

Please sign in to comment.