def USER(self): # ---------------- First time to add correct user ----------------# if str(self.OP1.toPlainText()) == "" or str( self.OP1.toPlainText()) == SettingsUs.Var_KNOW(): User, Permition, Access = Rfid.Rfid_Read(self, Settings.PRO3(), Settings.ACC2()) AddDataPR.first(self, User, Access) # ---------------- If you want to delet all, first find a user permition ----------------# else: User, Permition, Access = Rfid.Rfid_Read(self, Settings.PRO3(), Settings.ACC()) RemoveDataPR.All(self, Access)
def FindUser(TABLA: str, ID: str, PROCESS: str): engine = create_engine(TABLA, echo=True) Session = sessionmaker(engine) session = Session() ids = session.query(SQLUser).all() session.close() for IDD in ids: if IDD.Code == ID: if PROCESS == Settings.PRO1(): return (IDD.Name, IDD.Per1) elif PROCESS == Settings.PRO2(): return (IDD.Name, IDD.Per2) elif PROCESS == Settings.PRO3(): return (IDD.Name, IDD.Per3) elif PROCESS == Settings.PRO4(): return (IDD.Name, IDD.Per4) return (SettingsUs.Var_KNOW(), 0)