Beispiel #1
0
 def __setattr__(self,attrname,value):
     """
     DataStore api stores all prop values say "email" is stored in "_email" so
     we intercept the set attribute, see if it has changed, then check for an
     onchanged method for that property to call
     """
     if attrname.find('_') != 0:
         if hasattr(self,'_' + attrname):
             curval = getattr(self,'_' + attrname)
             if curval != value:
                 self.__isdirty = True
                 if hasattr(self,attrname + '_onchange'):
                     getattr(self,attrname + '_onchange')(curval,value)
     DBModel.__setattr__(self,attrname,value)
Beispiel #2
0
 def __setattr__(self, attrname, value):
     """
     DataStore api stores all prop values say "email" is stored in "_email" so
     we intercept the set attribute, see if it has changed, then check for an
     onchanged method for that property to call
     """
     if attrname.find('_') != 0:
         if hasattr(self, '_' + attrname):
             curval = getattr(self, '_' + attrname)
             if curval != value:
                 self.__isdirty = True
                 if hasattr(self, attrname + '_onchange'):
                     getattr(self, attrname + '_onchange')(curval, value)
     DBModel.__setattr__(self, attrname, value)