def usr_add(self, p_data): """ :param p_data: :return: """ _batch_id = p_data["batch_id"] _case_id = p_data["case_id"] _node = TabBatchDet() # Create id _node.id = gen_id("batch_det") # batch_id _node.batch_id = _batch_id # case_id _node.case_id = _case_id # create_time, modify_time _node.create_time = datetime.now() try: self.__session.add(_node) except: raise OrcDatabaseException self.__session.commit() return _node
def usr_add(self, p_data): """ :param p_data: :return: """ _node = WebPageDef() # Create id _node.id = gen_id("page_def") # page_flag _node.page_flag = p_data['page_flag'] if 'page_flag' in p_data else "" # page_desc _node.page_desc = p_data['page_desc'] if 'page_desc' in p_data else "" # comment _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException return _node
def usr_add(self, p_data): """ Add a new step :param p_data: :return: """ _node = TabStepDef() # Create id _node.id = gen_id("step_def") # step_no _node.step_no = self._create_no() # step_desc, comment _node.step_desc = p_data['step_desc'] if 'step_desc' in p_data else "" _node.step_type = p_data['step_type'] if 'step_type' in p_data else "" _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException return _node
def mod_add(self, p_data): """ 新增 :param p_data: :return: """ _node = LibDictionary() # Create id _node.id = gen_id("dict") # batch_no _node.dict_flag = p_data['dict_flag'] if 'dict_flag' in p_data else None # batch_type _node.dict_order = p_data[ 'dict_order'] if 'dict_order' in p_data else None # pid _node.dict_value = p_data[ 'dict_value'] if 'dict_value' in p_data else None # batch_name _node.dict_text = p_data['dict_text'] if 'dict_text' in p_data else None # batch_desc, comment _node.dict_desc = p_data['dict_desc'] if 'dict_desc' in p_data else None try: self.__session.add(_node) self.__session.commit() except Exception: raise OrcDatabaseException return _node
def usr_add(self, p_data): """ Add item :param p_data: :return: """ _case_id = p_data["case_id"] _step_id = p_data["step_id"] _node = TabCaseDet() # Create id _node.id = gen_id("case_det") # case_id _node.case_id = _case_id # step_id _node.step_id = _step_id # step_no _node.step_no = self.__create_no(_case_id) # create_time, modify_time _node.create_time = datetime.now() try: self.__session.add(_node) except: raise OrcDatabaseException self.__session.commit() return _node
def usr_add(self, p_data): """ Add a new case :param p_data: :return: """ _node = TabData() # Create id _node.id = gen_id("data") # test_env _node.test_env = p_data['test_env'] if 'test_env' in p_data else "" # src_id _node.src_id = p_data['src_id'] if 'src_id' in p_data else "" # src_type _node.src_type = p_data['src_type'] if 'src_type' in p_data else "" # data_flag _node.data_flag = p_data['data_flag'] if 'data_flag' in p_data else None # data_order _node.data_order = self._create_order(_node.src_id, _node.data_flag) # data_type _node.data_type = p_data['data_type'] if 'data_type' in p_data else "" # data_mode _node.data_mode = p_data['data_mode'] if 'data_mode' in p_data else "" # data_value _node.data_value = p_data['data_value'] if 'data_value' in p_data else "" # comment _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException return _node
def usr_add(self, p_data): """ :param p_data: :return: """ _node = WebWidgetDef() # Create id _node.id = gen_id("widget_def") # pid _node.pid = p_data['pid'] if 'pid' in p_data else None # widget_flag _node.widget_flag = p_data[ 'widget_flag'] if 'widget_flag' in p_data else "" # widget_type _node.widget_type = p_data[ 'widget_type'] if 'widget_type' in p_data else "" # widget_desc _node.widget_desc = p_data[ 'widget_desc'] if 'widget_desc' in p_data else "" # batch_desc, comment _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException # Modify self.usr_update({ "id": _node.id, "widget_path": self.usr_get_path(_node.id) }) return _node
def usr_add(self, p_data): """ Add a new case :param p_data: :return: """ _node = TabCaseDef() # Create id _node.id = gen_id("case_def") # pid _node.pid = p_data['pid'] if 'pid' in p_data else None # case_no _node.case_no = self._create_no(_node.pid) # case_name _node.case_name = p_data['case_name'] if 'case_name' in p_data else "" # case_desc, comment _node.case_desc = p_data['case_desc'] if 'case_desc' in p_data else "" _node.case_type = p_data['case_type'] if 'case_type' in p_data else "" _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException self.usr_update({ "id": _node.id, "case_path": self.usr_get_path(_node.id) }) return _node
def usr_add(self, p_data): """ 新增 :param p_data: :return: """ _node = TabBatchDef() # Create id _node.id = gen_id("batch_def") # batch_no _node.batch_no = self.__create_no() # batch_type _node.batch_type = p_data[ 'batch_type'] if 'batch_type' in p_data else None # pid _node.pid = p_data['pid'] if 'pid' in p_data else None # batch_name _node.batch_name = p_data[ 'batch_name'] if 'batch_name' in p_data else "" # batch_desc, comment _node.batch_desc = p_data[ 'batch_desc'] if 'batch_desc' in p_data else "" _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException return _node
def usr_add(self, p_data): """ Add a new case :param p_data: :return: """ _node = TabItem() # Create id _node.id = gen_id("item") # case_no _node.item_no = self._create_no() # item_type _node.item_type = p_data['item_type'] if 'item_type' in p_data else "" # item_mode _node.item_mode = p_data['item_mode'] if 'item_mode' in p_data else "" # item_operate _node.item_operate = json.dumps( p_data['item_operate']) if 'item_operate' in p_data else "" # item_desc _node.item_desc = p_data['item_desc'] if 'item_desc' in p_data else "" # case_desc, comment _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException return _node
def usr_add(self, p_data): """ :param p_data: :return: """ _node = WebWidgetDet() # Create id _node.id = gen_id("widget_det") # widget_id _node.widget_id = p_data['widget_id'] if 'widget_id' in p_data else "" # widget_order _node.widget_order = p_data['widget_order'] if 'widget_order' in p_data else "" # widget_attr_type _node.widget_attr_type = p_data['widget_attr_type'] if 'widget_attr_type' in p_data else "" # widget_attr_value _node.widget_attr_value = p_data['widget_attr_value'] if 'widget_attr_value' in p_data else "" # widget_desc _node.widget_desc = p_data['widget_desc'] if 'widget_desc' in p_data else "" # comment _node.comment = p_data['comment'] if 'comment' in p_data else "" # create_time, modify_time _node.create_time = datetime.now() _node.modify_time = datetime.now() try: self.__session.add(_node) self.__session.commit() except: raise OrcDatabaseException return _node