From 734b38f66c628f9dd30fae0f0451d8007a82a120 Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Sun, 11 Sep 2011 21:43:37 -0400 Subject: [PATCH] allow properties w/ setters to work with persistable classes --- tpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tpers.py b/tpers.py index 4b1044e..a37f5c4 100644 --- a/tpers.py +++ b/tpers.py @@ -81,6 +81,10 @@ class TPrs(object): __obj_setattr = object.__setattr__ __obj_delattr = object.__delattr__ def __setattr__(self, key, value): + prop = getattr(self.__class__, key, None) + if isinstance(prop, property) and prop.fset: + prop.fset(self, value) + return try: if self._fWriteToPersistent or key in self._persistent: self._persistent[key] = value