Skip to content

Commit cba57fa

Browse files
committed
Monkey patch QPyNullVariant to be represented as 'NULL'
1 parent 425b8b6 commit cba57fa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
def __nonzero__(self):
4444
return False
4545

46+
def __repr__(self):
47+
return 'NULL'
48+
4649
QPyNullVariant.__nonzero__ = MethodType(__nonzero__, None, QPyNullVariant)
50+
QPyNullVariant.__repr__ = MethodType(__repr__, None, QPyNullVariant)
4751
except ImportError:
4852
pass

0 commit comments

Comments
 (0)