Is there any way to change the response that comes from server only for CREATE and UPDATE requests so it look like
{ "root":
[ { "field1": "value1", "field2": "value2", "field3": "value3", "id": 12 ],
"success": true }
instead of:
{ "field1": "value1", "field2": "value2", "field3": "value3", "id": 12 }
Of course you can. Take a look at the hooks:
alter_list_data_to_serialize(self, request, data)
http://django-tastypie.readthedocs.org/en/latest/resources.html#alter-list-data-to-serialize
and
alter_detail_data_to_serialize(self, request, data)
http://django-tastypie.readthedocs.org/en/latest/resources.html#alter-detail-data-to-serialize