Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
    def save_oper_det(self, login,opname, descr, context_disp, entityid,dispname,icon):
        result = []
        dupOp=None
        operation=Operation()
        db=DBHelper()
        session=DBHelper().get_session()
        dupOp=session.query(Operation).filter(Operation.name==opname).first()
        if dupOp is None:
           operation.name=(opname)
           operation.description=(descr)
           operation.display_name=(dispname)
           operation.icon=(icon)
           operation.created_by=(login)
           operation.modified_by=(login)
           operation.created_date=datetime.now()

           if context_disp=="true":
              operation.display=True
           else:
              operation.display=False

           L=(entityid).split(',')
           for i in L:
                ent=session.query(EntityType).filter(EntityType.id==int(i)).first()
                operation.entityType.append(ent);

           db.add(operation)
           return result
        else:
            result="False"
            return result
Пример #4
0
    def save_oper_det(self, login, opname, descr, context_disp, entityid,
                      dispname, icon):
        result = []
        dupOp = None
        operation = Operation()
        db = DBHelper()
        session = DBHelper().get_session()
        dupOp = session.query(Operation).filter(
            Operation.name == opname).first()
        if dupOp is None:
            operation.name = (opname)
            operation.description = (descr)
            operation.display_name = (dispname)
            operation.icon = (icon)
            operation.created_by = (login)
            operation.modified_by = (login)
            operation.created_date = datetime.now()

            if context_disp == "true":
                operation.display = True
            else:
                operation.display = False

            L = (entityid).split(',')
            for i in L:
                ent = session.query(EntityType).filter(
                    EntityType.id == int(i)).first()
                operation.entityType.append(ent)

            db.add(operation)
            return result
        else:
            result = "False"
            return result