Ejemplo n.º 1
0
 def __setattr__(self, name, value):    
     if name in self.__dict__:
         self.__dict__[name] = value
     elif name in db_User.properties():
         setattr(self.usr, name, value)
     else:
         setattr(self.thing, name, value)
Ejemplo n.º 2
0
 def __getattr__(self, name):
     if name in db_User.properties():
         return getattr(self.usr, name)
     else:
         res =  getattr(self.thing, name)
         if not res and name in USER_THINGS_DEFAULT:
             return USER_THINGS_DEFAULT[name]
         return res