Sunday, June 10, 2012

Re: Request.Method Query !

If im understanding your question correctly ...
Django determines the request method itself and populates a dict with the method name in the request object. So if you want to handle data submitted via HTTP POST, request.POST will contain the data. For example:

def data_handler(request):
    if request.method == 'POST':
        for k,v in request.POST.iteritems():
            -- do stuff --


On Sun, Jun 10, 2012 at 12:05 PM, vinod kumar <vk.86.811@gmail.com> wrote:
Hey All,
 I have a small doubt. I can see in views that I can check the
request.method and accordingly write my code to perform the operation
for get/put/.. respectively. And in urls.py, the url reg. expression
is assigned to concerned functions. But how do u give the request
method i.e.get or put in urls or anywhere. Please help me out.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate