lazy: add __bool__ = __nonzero__ for py3 compatibility (#36515)
This commit is contained in:
parent
9e1cf8db69
commit
451e8adfe6
|
@ -529,6 +529,8 @@ class LazyFieldVar(object):
|
|||
return bool(self._data.get(self._field.id))
|
||||
return bool(self.get_value())
|
||||
|
||||
__bool__ = __nonzero__
|
||||
|
||||
def __contains__(self, value):
|
||||
if self._field.key == 'items':
|
||||
return misc.site_encode(value) in self._data.get(self._field.id)
|
||||
|
|
Loading…
Reference in New Issue