fromdjango.dbimportconnection,transactioncursor=connection.cursor()#獲得一個游標(cursor)對象cursor.execute('updateother_other2setname="李四"whereid=%s',[3])transaction.commit_unless_managed()#提交到數據庫我該怎么知道數據庫有沒有更新成功呢?
怎樣知道django數據庫有沒有操作成功?
慕慕森
2019-03-30 09:29:08