def updatesave_op_det(self, login,opid, opname, desc, entid, context_disp,dispname,icon): result = [] op=Operation() db=DBHelper() session=DBHelper().get_session() op=session.query(Operation).filter(Operation.id==opid).first() op.name=(opname) op.description=(desc) op.modified_date=datetime.now() op.modified_by=(login) op.display_name=(dispname) op.icon=(icon) if context_disp=="true": op.display=True else: op.display=False for i in op.entityType: op.entityType.remove(i); L=(entid).split(',') if entid !="": for i in L: ent=session.query(EntityType).filter(EntityType.id==int(i)).first() op.entityType.append(ent); db.update(op) return result
def updatesave_op_det(self, login, opid, opname, desc, entid, context_disp, dispname, icon): result = [] op = Operation() db = DBHelper() session = DBHelper().get_session() op = session.query(Operation).filter(Operation.id == opid).first() op.name = (opname) op.description = (desc) op.modified_date = datetime.now() op.modified_by = (login) op.display_name = (dispname) op.icon = (icon) if context_disp == "true": op.display = True else: op.display = False for i in op.entityType: op.entityType.remove(i) L = (entid).split(',') if entid != "": for i in L: ent = session.query(EntityType).filter( EntityType.id == int(i)).first() op.entityType.append(ent) db.update(op) return result
def updatesave_enttype_details(self, login, enttypeid ,enttypename, dispname): result = [] ent=EntityType(); db=DBHelper() session=DBHelper().get_session() ent=session.query(EntityType).filter(EntityType.id==enttypeid).first() ent.name=enttypename ent.display_name=dispname ent.modified_by=(login) ent.modified_date=datetime.now() db.update(ent); return result
def updatesave_enttype_details(self, login, enttypeid, enttypename, dispname): result = [] ent = EntityType() db = DBHelper() session = DBHelper().get_session() ent = session.query(EntityType).filter( EntityType.id == enttypeid).first() ent.name = enttypename ent.display_name = dispname ent.modified_by = (login) ent.modified_date = datetime.now() db.update(ent) return result
def updatesave_opsgroup_details(self, login,opsgroupid ,opsgroupname, opsgroupdesc,operation): result = [] opsgroup=OperationGroup(); db=DBHelper() session=DBHelper().get_session() opsgroup=session.query(OperationGroup).filter(OperationGroup.id==opsgroupid).first() opsgroup.name=opsgroupname opsgroup.description=opsgroupdesc opsgroup.modified_date=datetime.now() opsgroup.modified_by=(login) operation = operation[0:-1] L=(operation).split(',') for i in L: operation=session.query(Operation).filter(Operation.id==int(i)).first() opsgroup.operations.append(operation); db.update(opsgroup); return result
def updatesave_opsgroup_details(self, login, opsgroupid, opsgroupname, opsgroupdesc, operation): result = [] opsgroup = OperationGroup() db = DBHelper() session = DBHelper().get_session() opsgroup = session.query(OperationGroup).filter( OperationGroup.id == opsgroupid).first() opsgroup.name = opsgroupname opsgroup.description = opsgroupdesc opsgroup.modified_date = datetime.now() opsgroup.modified_by = (login) operation = operation[0:-1] L = (operation).split(',') for i in L: operation = session.query(Operation).filter( Operation.id == int(i)).first() opsgroup.operations.append(operation) db.update(opsgroup) return result