Do I need to explicitly use transactions with Django Rest Framework serializer updates?

前端 未结 3 2161
夕颜
夕颜 2020-12-10 17:24

According to http://www.django-rest-framework.org/api-guide/serializers/#writable-nested-representations, in order to accept a nested serializer I need to create an up

3条回答
  •  爱一瞬间的悲伤
    2020-12-10 17:46

    The related PR is unrelated to your question. PR is linked to the DRF specific exception handler that bypassed the default Django transaction scheme (https://github.com/tomchristie/django-rest-framework/pull/1204#issuecomment-52712621).

    DRF doesn't specifically wrap things in a transaction to leave the users free to choose whatever they want to.

提交回复
热议问题