On Wed, 2006-06-07 at 05:00 +0300, Elver Loho wrote:
[...]
> URL:
> (r'^make/$', 'latestbooks.latest.views.make_sidebar'),
> 
> HTML:
> <form action="/make" method="POST">
>                       <select name="days" size="1">
>                               <option selected="1" value="0">Ainult samal 
> paeval ilmunud raamatud</option>
>                               <option value="1">Täna ja eile ilmunud 
> raamatud</option>
> 
>                               <option value="2">Täna, eile ja üleeile ilmunud 
> raamatud</option>
>                       </select>
>                       <input type="text" name="foo" value="bar" />
>                       <input type="submit" value="Edasi" />
>                       </form>
> 
> VIEW:
> def make_sidebar(request):
>       
>       print "POST.keys()", request.POST.keys()
>       print "GET.keys()", request.GET.keys()
> 
> RESULT:
> [07/Jun/2006 04:50:23] "POST /make HTTP/1.1" 301 0
> POST.keys() []
> GET.keys() []
> [07/Jun/2006 04:50:23] "GET /make/ HTTP/1.1" 200 1063
> [07/Jun/2006 04:50:23] "GET /media/latestbooks.css HTTP/1.1" 304 0


One thing I would suggest is to change your form action to submit to
"/make/". The trailing slash will avoid the redirect you are seeing (the
301 response code). Note the warning in the HTTP/1.1 spec about
redirects from POSTs here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2

It looks like your POST is being resubmitted as a GET and the form
values may well be being dropped in the process (unless the redirected
URL shows them as converted to GET params).

Malcolm



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to