On Sat, Mar 14, 2009 at 4:54 PM, ihome <ihomest...@gmail.com> wrote: > > Hi, > > I defined a form to load data from HttpRequest in views.py. For the > same function, sometimes, I need to pass a POST request while some > times I need to pass in a GET request. > > For POST, I used > > MyForm(request.POST) > > to load the data and it works well. > > For GET method, MyForm(request.POST) does not work. Does the form only > support the instantiation of POST data? Do I have to use > request.GET.get(field_name) to retrieve each parameter value in the > query string? > > Thanks. > > > You can instantiate a form with request.GET just the same as you can with request.POST. MyForm(request.GET) works just fine.
Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---