This is an interesting approach I had not thought of before.  Thanks!

Agreed, CRUD is not the same as REST.

Brian

On Tue, Apr 12, 2011 at 10:51 AM, sebastien piquemal <seb...@gmail.com>wrote:

> Well ... http://django-rest-framework.org  allows you to override the
> method by adding a post parameter. So in your form, you just add a
> hidden input
>
> <input type="hidden" name="_method" value="PUT"/>
>
> or
>
> <input type="hidden" name="_method" value="DELETE"/>
>
> and django-rest-framework will pipe your POST request into the "put"
> handler or "delete" handler. Of course name="_method" can be
> configured (I mean that you can use another parameter name). That's a
> quite elegant way to overcome the limitation you are talking about
> (even though CRUD and REST are not exactly the same things).
>
> I am not sure that piston is still actively maintained ...
>
> On Apr 12, 3:57 pm, Brian Bouterse <bmbou...@gmail.com> wrote:
> > I've been reading through the documentation for piston and
> > django-rest-framework.org and they both look like great projects.  Could
> > anyone with experience working with either of these applications (or
> their
> > authors themselves) provide some compare and contrasting of the
> > features/usability/etc.
> >
> > Also, as a general REST-ism, the HTML
> > form<http://www.w3schools.com/tags/att_form_method.asp>tag doesn't
> > allow for HTTP methods besides GET and POST.  As such we
> > typically write a full REST API (GET, PUT, POST, DELETE), and then end up
> > doing the following to "make it work" for HTML/browser settings.
> >
> > CREATE - POST to /resource/
> > READ - GET to /resource/
> > UPDATE - POST to /resource/<id>
> > DELETE - POST to /resource/delete
> >
> > The really non-restful part of the "make it work for browsers" hack is
> > adding the verb delete into the URL.  I couldn't think of a better way.
> >  This is a common pattern I end up implementing a lot, and it would be
> cool
> > if a rest framework let me accomplish this in an easier way.
> >
> > Brian
> >
> > On Tue, Apr 12, 2011 at 6:23 AM, Tom Christie <christie....@gmail.com
> >wrote:
> >
> >
> >
> > > I've been working on this with some folks:
> >
> > >http://django-rest-framework.org
> >
> > > Released 0.1 a few weeks ago, and it's coming along *really* nicely.
> It's
> > > under v active development ATM. The auto-generated API browser is
> > > particularly cool. Really would advise anyone taking a look at building
> web
> > > APIs in python to take a look at it.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
> >
> > --
> > Brian Bouterse
> > ITng Services
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Brian Bouterse
ITng Services

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to