def updCfgByID(self, record_id, pltf_name = None, ip = None): searchPara = {'_id' : record_id} setContent = {'Refresh_Time' : bf.timeStamp()} if pltf_name is not None: setContent.update({'Cfg.Register_Name' : pltf_name}) if ip is not None: setContent.update({'Cfg.Debug_IP' : ip}) self.update('pltf_basic_info', searchPara, content) return True
def updCfgByID(self, record_id, pltf_name=None, ip=None): searchPara = {'_id': record_id} setContent = {'Refresh_Time': bf.timeStamp()} if pltf_name is not None: setContent.update({'Cfg.Register_Name': pltf_name}) if ip is not None: setContent.update({'Cfg.Debug_IP': ip}) self.update('pltf_basic_info', searchPara, content) return True
def insNewItem(self, content): setContent = { 'Refresh_Time': bf.timeStamp(), 'Cfg': { 'Register_Name': content['pltf_name'], 'Debug_IP': content['ip'], 'Site': content['site'] } } _id = self.insert('pltf_basic_info', setContent) return {'record_id': _id}
def updItemByCfg(self, content, pltf_name, ip): searchPara = { "$and": [{ 'Cfg.Debug_IP': { "$in": [ip], "$exists": 'true' } }, { 'Cfg.Register_Name': { "$in": [pltf_name], "$exists": 'true' } }] } content.update({'Refresh_Time': bf.timeStamp()}) self.update('pltf_basic_info', searchPara, content) return True
def insNewItem(self, content): setContent = {'Refresh_Time' : bf.timeStamp(), 'Cfg' : {'Register_Name' : content['pltf_name'], 'Debug_IP' : content['ip'], 'Site' : content['site']}} _id = self.insert('pltf_basic_info', setContent) return {'record_id' : _id}
def updItemByCfg(self, content, pltf_name, ip): searchPara = {"$and" : [{'Cfg.Debug_IP' : {"$in" : [ip] , "$exists" : 'true'}}, {'Cfg.Register_Name' : {"$in" : [pltf_name] , "$exists" : 'true'}}]} content.update({'Refresh_Time' : bf.timeStamp()}) self.update('pltf_basic_info', searchPara, content) return True
def updItemByID(self, content, record_id): searchPara = {'_id' : record_id} content.update({'Refresh_Time' : bf.timeStamp()}) self.update('pltf_basic_info', searchPara, content) return True
def updItemByID(self, content, record_id): searchPara = {'_id': record_id} content.update({'Refresh_Time': bf.timeStamp()}) self.update('pltf_basic_info', searchPara, content) return True