Skip to content
Snippets Groups Projects
Commit 24cc46a1 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

String properties, if set to '', will report a value of 'None'.

parent 5b5368c2
No related branches found
No related tags found
No related merge requests found
...@@ -412,6 +412,12 @@ class String(PropertyBase): ...@@ -412,6 +412,12 @@ class String(PropertyBase):
kwargs['default'] = kwargs.get('default', '') kwargs['default'] = kwargs.get('default', '')
PropertyBase.__init__(self, _StringVar, **kwargs) PropertyBase.__init__(self, _StringVar, **kwargs)
def __get__(self, instance, owner):
val = PropertyBase.__get__(self, instance, owner)
if val == '': return None
return val
def validate(self, instance, value): def validate(self, instance, value):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment