我需要这几行代码的帮助。我想选择一行并从数据库中删除表中的行。在
def deleteProduct(self):
row = self.products_table.currentRow()
if row > -1:
currentproductid = (self.products_table.item(row, 0).text(), )
query = session.query(Product).filter(Product.product_id==currentproductid).first()
session.delete(query)
session.commit()
self.mainTable.removeRow(currentRow)
我得到了这个错误:
^{pr2}$
相关问题 更多 >
编程相关推荐