Monkey patch QPyNullVariant to be represented as 'NULL'

This commit is contained in:
Matthias Kuhn 2013-08-28 13:14:00 +02:00
parent 425b8b67d7
commit cba57fa55a

View File

@ -43,6 +43,10 @@ try:
def __nonzero__(self):
return False
def __repr__(self):
return 'NULL'
QPyNullVariant.__nonzero__ = MethodType(__nonzero__, None, QPyNullVariant)
QPyNullVariant.__repr__ = MethodType(__repr__, None, QPyNullVariant)
except ImportError:
pass