(self, result, original = None)
Log changei into table log.changelog
Log changei into table log.changelog
Log changei into table log . changelog
def _log(self, result, original = None):
        """ Log changei into table log.changelog
        """
        if not self._logging:
            return
        changes = []
        for key in result.keys():
            if self._op == 'update':
                if key in original:
                    if str(original[key]) <> str(result[key]):
                        changes.append( key + ": " + str(original[key]) + " -> " + str(result[key]) )
            else:
                changes.append( key + ": " + str(result[key]) )
        self._ctx.log( self._table,  result[ self._id ], self._op, "\n".join(changes) )
def _log ( self , result , original = None ) : if not self . _logging : return changes = [ ] for key in result . keys ( ) : if self . _op == 'update' : if key in original : if str ( original [ key ] ) <> str ( result [ key ] ) : changes . append ( key + ": " + str ( original [ key ] ) + " -> " + str ( result [ key ] ) ) else : changes . append ( key + ": " + str ( result [ key ] ) ) self . _ctx . log ( self . _table , result [ self . _id ] , self . _op , "\n" . join ( changes ) )