Skip to content

Commit

Permalink
New minor version 1.0.2
Browse files Browse the repository at this point in the history
Add __bool__ method on Collection document ODM class
  • Loading branch information
MatteoGuadrini committed Apr 5, 2022
2 parents b792de5 + 2b4fd53 commit 88ee30e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion __info__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

"""Information variable used by modules on this package."""

__version__ = '1.0.1'
__version__ = '1.0.2'
__author__ = 'Matteo Guadrini'
__email__ = 'matteo.guadrini@hotmail.it'
__homepage__ = 'https://github.com/MatteoGuadrini/nosqlapi'
3 changes: 3 additions & 0 deletions nosqlapi/docdb/odm.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __len__(self):
def __iter__(self):
return (doc for doc in self.docs)

def __bool__(self):
return True if self.docs else False


class Document:

Expand Down
2 changes: 2 additions & 0 deletions nosqlapi/docdb/odm.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class Collection:

def __iter__(self) -> Iterator: ...

def __bool__(self) -> bool: ...


class Document:
id: Union[str, Uuid]
Expand Down

0 comments on commit 88ee30e

Please sign in to comment.