Re: POST to view loses POST data

2006-06-19 Thread Adrian Holovaty
On 6/17/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > I agree 100% with James on this one. Having request.POST be an empty > dictionary evaluating to True -- that's just too odd. I think we ought > to bite the bullet and add request.method, which would be a shortcut > to a normalized (all caps?

Re: POST to view loses POST data

2006-06-18 Thread Matt McDonald
I have to agree that it should return false if there is no data. Otherwise how are you going to tell the difference between a POST with no data and a POST with data. Another alternative is maybe request.method.POST and request.method.GET for testing the method. On 18/06/2006, at 9:20 PM, B

Re: POST to view loses POST data

2006-06-18 Thread Bill de hÓra
Bill de hÓra wrote: > Luke Plant wrote: >> Long version: >> request.POST is (essentially) a dictionary of post variables. As such, >> if it is empty, it evaluates to False, even if the request method is >> 'POST'. > > That's a bug, imo. Never mind - request.META["REQUEST_METHOD"] is news to

Re: POST to view loses POST data

2006-06-18 Thread Bill de hÓra
Luke Plant wrote: > > Long version: > request.POST is (essentially) a dictionary of post variables. As such, > if it is empty, it evaluates to False, even if the request method is > 'POST'. That's a bug, imo. cheers Bill --~--~-~--~~~---~--~~ You received th

Re: POST to view loses POST data

2006-06-18 Thread gabor
Adrian Holovaty wrote: > On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote: >> I'm not convinced that it'd be a good thing to have request.POST >> evaluate to True in these cases, but the reasoning is somewhat >> pedantic. >> >> First and foremost, there's a logical difference between the reques

Re: POST to view loses POST data

2006-06-17 Thread Ivan Sagalaev
Adrian Holovaty wrote: > I think we ought > to bite the bullet and add request.method, which would be a shortcut > to a normalized (all caps?) version of request.META['REQUEST_METHOD'], > which is cumbersome to type and might not (?) always be upper case. > Per HTTP all request methods are defi

Re: POST to view loses POST data

2006-06-17 Thread Adrian Holovaty
On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote: > I'm not convinced that it'd be a good thing to have request.POST > evaluate to True in these cases, but the reasoning is somewhat > pedantic. > > First and foremost, there's a logical difference between the request > method and the request par

Re: POST to view loses POST data

2006-06-17 Thread Jeremy Dunck
On 6/17/06, James Bennett <[EMAIL PROTECTED]> wrote: > I'm not convinced that it'd be a good thing to have request.POST > evaluate to True in these cases, but the reasoning is somewhat > pedantic. I put the comment on the ticket. The use of request.POST seems overloaded to mean both "is it a pos

Re: POST to view loses POST data

2006-06-17 Thread James Bennett
On 6/17/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > There is already a way to test for posts via the request object: > request.META['REQUEST_METHOD']. But your suggestion is not unreasonable, > so best to file a ticket so that it can be considered without being > forgotten. I'm not convin

Re: POST to view loses POST data

2006-06-17 Thread Jeremy Dunck
On 6/17/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > There is already a way to test for posts via the request object: > request.META['REQUEST_METHOD']. But your suggestion is not unreasonable, > so best to file a ticket so that it can be considered without being > forgotten. Filed: http://

Re: POST to view loses POST data

2006-06-17 Thread Jeremy Dunck
On 6/17/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > The implementation side is easy, if we decided to go this route: make > sure that __nonzero__() on the MultiValueDict class returns the right > thing in these cases. Sorry, I dug around in python introspection docs a bit trying to find w

Re: POST to view loses POST data

2006-06-17 Thread Max Battcher
Jeremy Dunck wrote: > On 6/17/06, Luke Plant <[EMAIL PROTECTED]> wrote: >> Long version: >> request.POST is (essentially) a dictionary of post variables. As such, >> if it is empty, it evaluates to False, even if the request method is >> 'POST'. In your form, you don't have a single 'successful'

Re: POST to view loses POST data

2006-06-17 Thread Malcolm Tredinnick
On Sat, 2006-06-17 at 19:44 -0500, Jeremy Dunck wrote: > On 6/17/06, Luke Plant <[EMAIL PROTECTED]> wrote: > > Long version: > > request.POST is (essentially) a dictionary of post variables. As such, > > if it is empty, it evaluates to False, even if the request method is > > 'POST'. In your for

Re: POST to view loses POST data

2006-06-17 Thread Jeremy Dunck
On 6/17/06, Luke Plant <[EMAIL PROTECTED]> wrote: > Long version: > request.POST is (essentially) a dictionary of post variables. As such, > if it is empty, it evaluates to False, even if the request method is > 'POST'. In your form, you don't have a single 'successful' field -- > the only field

Re: POST to view loses POST data

2006-06-17 Thread Luke Plant
On Sunday 18 June 2006 00:37, jacob wrote: > I have an inbox template that generates a list of links to messages > with the necessary trailing slash like this: > > blah blah > > That link takes you to the message view which has a form that looks > like this: > > > > Short version:

POST to view loses POST data

2006-06-17 Thread jacob
Yes, I've read http://code.djangoproject.com/wiki/NewbieMistakes This is my URL list: urlpatterns = patterns('', (r'^admin/', include('django.contrib.admin.urls')), (r'^settings/$','file.app.views.settings'), (r'^inbox/$','file.app.views.inbox'), (r'^sent/$','file