Dec-04-2018, 09:45 AM
How can I dynamically select row and get the product id value for the selected product to be passed into the query?
def deleteProduct(self):
row = self.products_table.currentRow()
if row > -1:
product_id = (self.products_table.item(row, 0).text(), )
query = session.query(Product).filter(Product.product_id=='product_id').first()
session.delete(query)
session.commit()
#self.dbCursor.execute("""DELETE FROM Main WHERE username=?""", currentUsername)
#self.dbConn.commit()
self.products_table.removeRow(row)
