allow properties w/ setters to work with persistable classes
This commit is contained in:
parent
1ca029e2b6
commit
734b38f66c
4
tpers.py
4
tpers.py
|
@ -81,6 +81,10 @@ class TPrs(object):
|
||||||
__obj_setattr = object.__setattr__
|
__obj_setattr = object.__setattr__
|
||||||
__obj_delattr = object.__delattr__
|
__obj_delattr = object.__delattr__
|
||||||
def __setattr__(self, key, value):
|
def __setattr__(self, key, value):
|
||||||
|
prop = getattr(self.__class__, key, None)
|
||||||
|
if isinstance(prop, property) and prop.fset:
|
||||||
|
prop.fset(self, value)
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
if self._fWriteToPersistent or key in self._persistent:
|
if self._fWriteToPersistent or key in self._persistent:
|
||||||
self._persistent[key] = value
|
self._persistent[key] = value
|
||||||
|
|
Loading…
Reference in a new issue