Good evening community.
I have a query in sqlite3 that I made in the Sales table which is the following:
import sqlite3
fecha ="12/08/2018"
conexion = sqlite3.connect("Users.db")
cursor = conexion.cursor()
cursor.execute("SELECT * FROM Ventas WHERE Fecha= ?",(fecha,))
for i in cursor:
print(i)
and I have the function shown in the Sales table:
dbs = QtSql.QSqlDatabase.addDatabase('QSQLITE')
dbs.setDatabaseName('Users.db')
dbs.open()
model = QtSql.QSqlTableModel()
model.setTable('Ventas')
model.setEditStrategy(QtSql.QSqlTableModel.OnManualSubmit)
model.select()
tabla.setModel(model)
I want to know how I could show in this case only the data of the query that I made in the above code, which would show the data only of the established date. And not that it shows all the data of the Table