Re: Solving the POST-data-lost-after-redirect problem

2006-06-08 Thread Luke Plant
Steven Armstrong wrote: > I believe you do something similar in the admin when a session is > expired and you redirect to the login form. Actually this works differently -- no 'redirecting' is done - instead the view function is wrapped, and the view is essentially replaced with a login form

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Adrian Holovaty
On 6/6/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > I like this one. I would prefer to see the error is thrown whenever we > are going to add a slash and the method is POST. Checking for POST data > is probably over-specialising. The problem we are trying to solve is > User Agents

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Matt McDonald
You could also use Tidy, there's a couple python wrappers for it: TidyLib wrapper: http://utidylib.berlios.de/ Classic Tidy: http://www.egenix.com/files/python/mxTidy.html Which should work on all platforms and can even be used to correct the page before outputting it. On 08/06/2006, at 1:00

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Max Battcher
Luke Plant wrote: > I'm not sure how useful it is for Mac and Windows users. The middleware > doesn't actually do any validation -- it's done by 'validate' from > Debian's 'wdg-html-validator'. I personally wrap that in a shell > script which beeps and pops up a KDE notification when a page

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Adrian Holovaty
On 6/7/06, Luke Plant <[EMAIL PROTECTED]> wrote: > I'm not sure how useful it is for Mac and Windows users. The middleware > doesn't actually do any validation -- it's done by 'validate' from > Debian's 'wdg-html-validator'. I personally wrap that in a shell > script which beeps and pops up a

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Luke Plant
On Wednesday 07 June 2006 15:49, Adrian Holovaty wrote: > Should we add the HTML-validation middleware to Django contrib? Luke, > would you be interersted in that? I would be fine with that -- it's nice to have something to give back, and if it raises the standard of Django apps being released

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Jeremy Dunck
On 6/7/06, Steven Armstrong <[EMAIL PROTECTED]> wrote: ... > GET /some/url/?cm_data_id=78fsd8fasdf7ad8asaf7889sdf > > - load POST/GET data from /tmp/78fsd8fasdf7ad8asaf7889sdf, populate > POST/GET dicts with it > - remove cm_data_id from GET variables > - delete /tmp/78fsd8fasdf7ad8asaf7889sdf >

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Steven Armstrong
On 06/07/06 05:11, Adrian Holovaty wrote: > http://code.djangoproject.com/wiki/NewbieMistakes#POSTtoviewslosesPOSTdata > > It's about time to solve this one. Who has a creative, elegant solution? :-) > > Some ideas, just to start discussion -- > > * THROW ERROR ON POST: The CommonMiddleware,

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Simon Willison
On 7 Jun 2006, at 16:23, Jeremy Dunck wrote: > Hmm, this sort of thing suggests that "email when bad stuff happens" > would be a nice general feature. ... or a general logging feature (with the ability to send email as one of the log actions).

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Jeremy Dunck
On 6/7/06, Luke Plant <[EMAIL PROTECTED]> wrote: > I already wrote a validator app that checks > outgoing HTML for validity, using a middleware to intercept the > response. It also stores all details of failed pages so you can go > back to them, which would be overkill in this case. Hmm, this

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Adrian Holovaty
On 6/7/06, Luke Plant <[EMAIL PROTECTED]> wrote: > My pleasure. I've updated it for magic-removal (and that version is > uploaded to my bzr repos), but I need to package it up and release it > properly. When I finally get time to do that I'll post a blog about it > or something. Should we add

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Luke Plant
Malcolm Tredinnick wrote: > Not entirely on-topic, but I must say that I think your HTML validation > middleware deserves to be much better known. I was using it last week to > check out some pages prior to release. It's very handy in development. > > Thanks. :-) My pleasure. I've updated it

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Malcolm Tredinnick
On Wed, 2006-06-07 at 02:12 -0700, Luke Plant wrote: > > Simon Willison wrote: > > > It's certainly a nasty solution here, but we shouldn't rule > > inspecting generated pages for errors out completely - just as long > > as anything like that is hived off in to a specialist tool. > > You could

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Luke Plant
Simon Willison wrote: > It's certainly a nasty solution here, but we shouldn't rule > inspecting generated pages for errors out completely - just as long > as anything like that is hived off in to a specialist tool. You could do this pretty easily as a 'debug' middleware that is enabled by

Re: Solving the POST-data-lost-after-redirect problem

2006-06-07 Thread Simon Willison
On 7 Jun 2006, at 04:11, Adrian Holovaty wrote: > * THROW ERROR ON FORM DISPLAY: If the APPEND_SLASH setting is set to > True and the CommonMiddleware is activated, Django could check the > output of every page for a whose method is POST and has an > "action" whose URL doesn't end in a slash.

Re: Solving the POST-data-lost-after-redirect problem

2006-06-06 Thread Jeremy Dunck
On 6/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > * THROW ERROR ON POST: The CommonMiddleware, when adding a slash and > redirecting, can check for POST data. If it finds any, it somehow logs > the error or otherwise alerts the developer. Maybe if DEBUG=True it > can actually display an

Re: Solving the POST-data-lost-after-redirect problem

2006-06-06 Thread Malcolm Tredinnick
On Tue, 2006-06-06 at 22:11 -0500, Adrian Holovaty wrote: > http://code.djangoproject.com/wiki/NewbieMistakes#POSTtoviewslosesPOSTdata > > It's about time to solve this one. Who has a creative, elegant solution? :-) > > Some ideas, just to start discussion -- > > * THROW ERROR ON POST: The