autochoose WHERE & AND in queryeditline
This commit is contained in:
parent
6b00dac638
commit
a6f70d9492
16
lib/gui.py
16
lib/gui.py
@ -33,6 +33,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.customcmd = ''
|
self.customcmd = ''
|
||||||
self.cmd = ''
|
self.cmd = ''
|
||||||
self.setWindowTitle("DB_Inspector")
|
self.setWindowTitle("DB_Inspector")
|
||||||
|
self.isAWhere = False
|
||||||
|
|
||||||
self.layout = QVBoxLayout()
|
self.layout = QVBoxLayout()
|
||||||
self.layout2 = QHBoxLayout()
|
self.layout2 = QHBoxLayout()
|
||||||
@ -124,13 +125,22 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
self.cmdCanton = ''
|
self.cmdCanton = ''
|
||||||
print("disable filter")
|
print("disable fil§.ter")
|
||||||
# self.customSQL(self.cmd)
|
# self.customSQL(self.cmd)
|
||||||
|
|
||||||
def queryEditLine(self):
|
def queryEditLine(self):
|
||||||
self.cmd = self.EditQuery.text()
|
self.cmd = self.EditQuery.text()
|
||||||
print(self.initcmd + self.cmdCanton +self.customcmd + self.cmd)
|
if self.customcmd or self.cmd:
|
||||||
self.customSQL(self.initcmd+ self.cmdCanton + self.customcmd + 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)
|
addFineFilter("../db/sqlite3.db","filters",self.customcmd + self.cmd)
|
||||||
|
|
||||||
def cell_clicked(self):
|
def cell_clicked(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user