Hi Limodou,

Not sure about your decorator idea, personally I think it goes beyond the scope of the url's in general and django's urlpatterns and is quite view specific.

Any ideas about implementing the GET/POST/PUT/DELETE etc..?


Met vriendelijke groet,

Simon de Haan

Eight Media
+31 (0)26 38 42 440



On Sep 22, 2006, at 9:18 AM, limodou wrote:


On 9/22/06, Ahmad Alhashemi <[EMAIL PROTECTED]> wrote:

+1 on the idea.

It is starting to make less and less sense to treat a GET and a POST
the same way just because they use the same URL.

I don't think the implementation is ugly, either. I can't see how it
can be made cleaner, except for using constants instead of strings for
GET, POST, ..etc. But then again, we are probably getting those as
strings from the backends.


If these things can be done, so if it also can support some
decorators, for example:

from django.conf.urls.defaults import *

urlpatterns = patterns('',
    # Example:
    (r'^django_rest_urls/get/(?P<id>\d+)',
         {'decorator':['utils.user_need_to_admin']},
         'django_rest_urls.restful.views.get'),
    )

I don'et think carefully about the format, just an idea. So we don't
need to write the decorator in the view code, just write them in
urls.py. And I think it will be easier maintained.

-- 
I like python!


--~--~---------~--~----~------------~-------~--~----~
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