how to use transaction of mysql in “save_model” and “delete_model” of django admin
问题 class DispatchAdmin(admin.ModelAdmin): def delete_model(self, request, obj): a.delete() b.delete() def save_model(self,request,obj,form,change): x.save() y.save() __ _ __ _ __ How can I _ __ _ ____ how can I make the operation to the mysql database as a atomic operation by using the transaction? what should be "import",and if the action is failed, how to rollback?(notes:since I use django admin,there is no extra views.py) 来源: https://stackoverflow.com/questions/19003442/how-to-use-transaction