Django mysql 中事务操作

事务操作

from django.db import transaction
from django.db import models


try:
    with transaction.atomic():
        # 事务
        # 一系列的操作
        pass
    
except Exception as e:
    print(e)

  

posted @ 2021-08-19 18:51  Star-Hitian  阅读(24)  评论(0编辑  收藏  举报