Skip to content
Permalink
Browse files

Properly report QgsDefaultValue.__bool__ in Python

  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent f2d512a commit 900be9f57f76acdd64bdf14b721c8d69ba509b1f
Showing with 5 additions and 0 deletions.
  1. +5 −0 python/core/__init__.py
@@ -41,9 +41,14 @@ def _geometryNonZero(self):
return not self.isEmpty()


def _isValid(self):
return self.isValid()

QgsGeometry.__nonzero__ = _geometryNonZero
QgsGeometry.__bool__ = _geometryNonZero

QgsDefaultValue.__bool__ = _isValid


def register_function(function, arg_count, group, usesgeometry=False,
referenced_columns=[QgsFeatureRequest.ALL_ATTRIBUTES], **kwargs):

0 comments on commit 900be9f

Please sign in to comment.
You can’t perform that action at this time.