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, the object is created, I get nothing in response, though. What I would like is to receive the JSON form of the newly created object (or at least the PK).
I tried overriding the dehydrate
method, but it seems that it's not even called when it comes to POST.
Any ideas?
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With