Skip to content

Commit

Permalink
Monkey patch QPyNullVariant to be represented as 'NULL'
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 28, 2013
1 parent 425b8b6 commit cba57fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/__init__.py
Expand Up @@ -43,6 +43,10 @@
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

0 comments on commit cba57fa

Please sign in to comment.