Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create ,UPDATE and DELETE call using django-tastypie

I am using django-tastypie to build the API for my project. I followed the tastypie-doc.

Using this doc I am able to call the GET method and filter the data based on the parameter. But I couldn't find any examples for PUT(UPDATE), DELETE (delete object) and POST(Create a new object).

Does anyone know how to write a call to create, update and delete in django-tastypie?

Thanks to all.

like image 258
Shashi Avatar asked Jul 19 '11 08:07

Shashi


1 Answers

post_list and other post commands are CREATEs, while puts are updates and deletes are deletes. There are also obj_ methods that implement these methods.

You can also take a look at the examples at http://django-tastypie.readthedocs.org/en/latest/cookbook.html which show how to do each of the basic actions.

Also, try some general Django tutorials, as they should also provide you with relevant information.

like image 115
agf Avatar answered Oct 17 '22 01:10

agf