On Sun, Apr 14, 2013 at 2:40 PM, Luke Plant <l.plant...@cantab.net> wrote:

> One reason for not doing this kind of despatch is that handling for
> different HTTP methods often involves a lot of common code. The classic
> form workflow would become longer, more complicated and/or less DRY if
> it was implemented using two functions instead of one:
>
> https://docs.djangoproject.com/en/dev/topics/forms/#using-a-form-in-a-view
>
> So, I would disagree that dispatching on HTTP verb would lead to vastly
> better code - it could easily make things worse.
>
>
Form handling seems like the only common place that a view would want to
handle different methods coming in, most of the time it makes much more
sense to break up the view into one for each HTTP Method.  In essence, what
we're doing is creating our own mini-dispatch in the view and it's clumsy
most of the time and leads to less RESTful layouts.

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


Reply via email to