def isCreateExists(self, s, params): ''' 判断新增时记录是否存在 ''' d = {} for i in self.exists: d[i] = {'value': params[i], 'name': self.exists[i]} return isExists(s, Role, d)
def isSaveExists(self, s, params, data): ''' 判断修改时记录是否存在 ''' d = {} for i in self.exists: if params.has_key(i) and params[i] != data.__dict__[i]: d[i] = {'value': params[i], 'name': self.exists[i]} return isExists(s, Role, d)
def isSaveExists(self, s, params, data): ''' 判断修改时记录是否存在 ''' d = {} for i in self.exists: if i in params and params[i] != data.__dict__[i]: d[i] = { 'value': params[i], 'name': self.exists[i] } return isExists(s, Menu, d)