0

Through my extensive research I've discovered that there is an HTTP method becoming popular called "Patch" (it is being implemented in Rails 4.0). Its kind of like the PUT method, except it is used for attribute updating rather than replacing an entire object. I've found that I have need for this method in piston. I also need to replace objects sometimes, so I can't just use PUT for updating attributes, I need both. I wanted to see if I could find a way to use PATCH. Does anyone know if piston supports this method, or know of a way to make piston support this method. I couldn't find it in their documentation anywhere.

I'm using piston with django on python 2.7.

Let me know if I didn't make my question clear enough.

Thanks

Hoopdady
  • 2,296
  • 3
  • 25
  • 40
  • Is there a specific reason you dont use tastypie instead of piston? BTW tastypie supports the PATCH method. – rantanplan Oct 11 '12 at 13:03
  • Hmm.... That would have been nice to know 3 months ago. How hard is it to change from piston to tastypie. I didn't know I needed this functionality until this morning. So my development team has been using piston for a while now and has a lot of code using it. That's the only thing that I think would prevent me from changing. – Hoopdady Oct 11 '12 at 13:09
  • Generally tastypie is more popular nowadays and well maintained. I don't think it much different for the simple cases. All in all, if you haven't shipped any production code yet, it'd be safer to go with tastypie or django rest framework. – rantanplan Oct 11 '12 at 13:13
  • I just talked to the developer that made the decision to use piston. He said that tastypie doesn't follow foreign keys to get related models and piston can. So when we get the info on the browser side we'd have to do another api call to get the info from the foreign key. I don't know if that is true or not, but our site is driven by a very relational database and we need to get a lot info through foreign keys. So I can see having to make separate api calls to get more info slowing the site down. Is there a way in tastypie to follow foreign keys – Hoopdady Oct 11 '12 at 13:19
  • It does follow if you want. http://django-tastypie.readthedocs.org/en/latest/fields.html#full – rantanplan Oct 11 '12 at 14:21
  • While we're suggesting library changes, a quick shout out to [django-rest-framework](http://django-rest-framework.org/). Auto-generates a slick browsable API reference. Can't help you with your actual question, though :(. – dokkaebi Oct 11 '12 at 17:08

0 Answers0