Made sure that the various _SaverMutable objects evaluate to False when they are empty.

This commit is contained in:
Griatch 2016-06-26 11:56:58 +02:00
parent 7c55ca6665
commit 96542418c0

View file

@ -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: