autochoose WHERE & AND in queryeditline

This commit is contained in:
ccppi 2024-06-18 12:04:00 +02:00
parent 6b00dac638
commit a6f70d9492

View File

@ -33,6 +33,7 @@ class MainWindow(QMainWindow):
self.customcmd = ''
self.cmd = ''
self.setWindowTitle("DB_Inspector")
self.isAWhere = False
self.layout = QVBoxLayout()
self.layout2 = QHBoxLayout()
@ -124,13 +125,22 @@ class MainWindow(QMainWindow):
else:
self.cmdCanton = ''
print("disable filter")
print("disable fil§.ter")
# self.customSQL(self.cmd)
def queryEditLine(self):
self.cmd = self.EditQuery.text()
print(self.initcmd + self.cmdCanton +self.customcmd + self.cmd)
self.customSQL(self.initcmd+ self.cmdCanton + self.customcmd + self.cmd)
if self.customcmd or self.cmd:
if self.cmdCanton:
self.isAWhere = True
connectingstring = " AND "
else:
self.isAWhere = False
connectingstring = " WHERE "
else:
connectingstring = ' '
print(self.initcmd + self.cmdCanton +connectingstring +self.customcmd + self.cmd)
self.customSQL(self.initcmd+ self.cmdCanton + connectingstring + self.customcmd + self.cmd)
addFineFilter("../db/sqlite3.db","filters",self.customcmd + self.cmd)
def cell_clicked(self):