Re: Request method in urls.py

2013-04-15 Thread Brantley Harris
On Mon, Apr 15, 2013 at 6:32 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > > On Tue, Apr 16, 2013 at 6:12 AM, Brantley Harris wrote: > >> Alex, I see http methods as being very basic, a part of the URL itself. >> In other words, from the level of the web

Re: Request method in urls.py

2013-04-15 Thread Russell Keith-Magee
On Tue, Apr 16, 2013 at 6:12 AM, Brantley Harris wrote: > Alex, I see http methods as being very basic, a part of the URL itself. > In other words, from the level of the web framework it's pointless to talk > about the URL as anything but a pair of request method and path.

Re: Request method in urls.py

2013-04-15 Thread Brantley Harris
Alex, I see http methods as being very basic, a part of the URL itself. In other words, from the level of the web framework it's pointless to talk about the URL as anything but a pair of request method and path. Strangely, I'm not sure I agree with you that intelligent dispatch decisions

Re: Request method in urls.py

2013-04-15 Thread Alex Ogier
On Mon, Apr 15, 2013 at 1:22 PM, Donald Stufft wrote: > > On Apr 15, 2013, at 1:16 PM, Alex Ogier wrote: > > The problem I have with fallthrough-based dispatch is that it encourages > really expensive performance-killing patterns, where you end up doing a

Re: Request method in urls.py

2013-04-15 Thread Donald Stufft
On Apr 15, 2013, at 1:16 PM, Alex Ogier wrote: > The problem I have with fallthrough-based dispatch is that it encourages > really expensive performance-killing patterns, where you end up doing a > linear scan over view functions round-tripping to the database for each

Re: Request method in urls.py

2013-04-15 Thread Alex Ogier
The problem I have with fallthrough-based dispatch is that it encourages really expensive performance-killing patterns, where you end up doing a linear scan over view functions round-tripping to the database for each one to see if the view can handle the request. multiurl is sort of nice because

Re: Request method in urls.py

2013-04-15 Thread Tom Christie
This proposal is actually *very* similar to the 'URL dispatcher fall-though' threadthat came up recently. I don't think it'd take much adjustment to take Jacob's django-multiurl project

Re: Request method in urls.py

2013-04-15 Thread Luke Plant
On 15/04/13 10:21, Aymeric Augustin wrote: > Django already has a syntax for that : > > from django.conf.urls import * > from django.views.decorators.http import * > > urlpatterns = patterns('', > url(require_GET(view_that_only_accepts_get), name='accept-get'), >

Re: Request method in urls.py

2013-04-15 Thread Łukasz Langa
On 15 kwi 2013, at 11:21, Aymeric Augustin wrote: > Not every feature has to be supported via keyword arguments in the URLconf. > Many are expressed through decorators. > > The URL dispatcher might have been designed differently in the first place, > but

Re: Request method in urls.py

2013-04-15 Thread Aymeric Augustin
2013/4/15 Alex Ogier > I agree, I think there are use cases for both types of dispatch, and it > seems clean and well-defined to make a route that is valid for only a > subset of HTTP methods. I guess there are a few corner cases to think > about, for example should

Re: Request method in urls.py

2013-04-14 Thread Alex Ogier
I agree, I think there are use cases for both types of dispatch, and it seems clean and well-defined to make a route that is valid for only a subset of HTTP methods. I guess there are a few corner cases to think about, for example should Django's url resolver start returning 405s instead of 404s

Re: Request method in urls.py

2013-04-14 Thread Brantley Harris
On Sun, Apr 14, 2013 at 2:40 PM, Luke Plant 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

Re: Request method in urls.py

2013-04-14 Thread Luke Plant
On 13/04/13 22:48, Brantley Harris wrote: > There's a line in the django URL Dispatcher documentation that is pretty > weird: > > The URLconf doesn’t look at the request method. In other words, all > request methods – POST, GET, HEAD, etc. – will be routed to the same > function for

Re: Request method in urls.py

2013-04-14 Thread Brantley Harris
On Sun, Apr 14, 2013 at 4:56 AM, Łukasz Langa wrote: > On 13 kwi 2013, at 23:48, Brantley Harris wrote: > > > It would be extremely easy to implement > > Such a statement suggests that the you didn't really think the problem > through. Few things are

Re: Request method in urls.py

2013-04-14 Thread Łukasz Langa
On 13 kwi 2013, at 23:48, Brantley Harris wrote: > It would be extremely easy to implement Such a statement suggests that the you didn't really think the problem through. Few things are "extremely easy to implement", especially in a framework with years of legacy

Request method in urls.py

2013-04-13 Thread Brantley Harris
There's a line in the django URL Dispatcher documentation that is pretty weird: The URLconf doesn’t look at the request method. In other words, all request > methods – POST, GET, HEAD, etc. – will be routed to the same function for > the same URL. Well, why? Most modern web frameworks allow