Yeah I get it and agree with you.

So your suggestion is to not implement this in the urlpatterns and introduce it as a dispatcher in the view?

Met vriendelijke groet,

Simon de Haan

Eight Media
+31 (0)26 38 42 440



On Sep 22, 2006, at 10:01 AM, Malcolm Tredinnick wrote:


On Fri, 2006-09-22 at 08:51 +0200, Simon de Haan wrote:
Hello everyone,

I've posted a patch in trac which will allow the urlresolver to  
select a view depending on the HTTP method (GET,POST,PUT,DELETE, etc..)

My implementation has been hacked together in a few minutes and isn't  
pretty by any standards but Malcom suggested I pitch it here to start  
a bit of a discussion.
[...]
urlpatterns = patterns('',
     # Example:
     (r'^django_rest_urls/get/(?P<id>\d+)',  
'django_rest_urls.restful.views.get'),
     (r'^django_rest_urls/(?P<id>\d+)', {'GET': 'django_rest_urls.restful.views.get',
'POST': 'django_rest_urls.restful.views.post',
'PUT': 'django_rest_urls.restful.views.put',
'DELETE': 'django_rest_urls.restful.views.delete',
}),

For the record, my main complaint here is that suddenly we now start
getting different behaviours, depending upon whether you have a function
or a dictionary as the second argument. It really does make for code
that is harder to read six to 24 months down the track.

Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to