Returning data on POST in django-tastypie

后端 未结 1 1544
庸人自扰
庸人自扰 2020-12-29 04:10

I consider it a standard that an object-creating function returns the newly created object.

So, any idea how do you do that in tastypie? When I send the POST request

相关标签:
1条回答
  • 2020-12-29 04:22

    Can't believe the answer was so easy.

    http://django-tastypie.readthedocs.org/en/latest/resources.html#always-return-data

    Just add always_return_data = True to your Meta.

    0 讨论(0)
提交回复
热议问题