示例#1
0
 def __setattr__(self, k, v):
     if _handle_property(self, k):
         if k in self._properties:
             self._properties[k].value = v
         else:
             self._properties[k] = Property(name=k, value=v)
     else:
         Model.__setattr__(self, k, v)
示例#2
0
 def __getattr__(self, k):
     if _handle_property(self, k):
         if k in self._properties:
             return self._properties[k].value
         else:
             raise AttributeError(k)
     else:
         return Model.__getattribute__(self, k)