#15645: HTTP methods in urls.py
-------------------------------------+-------------------------------------
Reporter: haras | Owner: nobody
Status: new | Milestone:
Component: HTTP | Version:
handling | Keywords: http urls
Resolution: | Has patch: 0
Triage Stage: Design | Needs tests: 0
decision needed |
Needs documentation: 0 |
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Comment (by haras):
it could be backward compatible.
if it would work only if there is an url() function, not simple list ()
and url will check for its first param, if it is HTTP method GET, PUT,
DELETE, POST, etc, then do action with regex and view
it not, do the old way
However I think it is not necessary complicated.
I suggest a http function:
{{{
urlpatterns = patterns('',
http ('POST', r'/user/(?P<username>\d+)$', 'myapp.views.user.view1'),
http ('GET', r'/user/(?P<username>\d+)$', 'myapp.views.user.view2'),
http ('DELETE', r'/user/(?P<username>\d+)$', 'myapp.views.user.delete'),
)
}}}
and url do the same as it is now
--
Ticket URL: <http://code.djangoproject.com/ticket/15645#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en.