Made sure that the various _SaverMutable objects evaluate to False when they are empty.
This commit is contained in:
parent
7c55ca6665
commit
96542418c0
1 changed files with 4 additions and 0 deletions
|
|
@ -131,6 +131,10 @@ class _SaverMutable(object):
|
|||
self._db_obj = kwargs.pop("db_obj", None)
|
||||
self._data = None
|
||||
|
||||
def __nonzero__(self):
|
||||
"Make sure to evaluate as False if empty"
|
||||
return bool(self._data)
|
||||
|
||||
def _save_tree(self):
|
||||
"recursively traverse back up the tree, save when we reach the root"
|
||||
if self._parent:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue