Re: Raising Http Redirect

2008-01-02 Thread Marty Alchin
Given that I've thought a bit about this not too long ago[1], I'll pipe in with my little bit of philosophy, along with some advice on the topic at hand. Exceptions are, by definition, exceptional. They defy the rule. That could mean errors, but it could also mean any other situation that a

Re: Raising Http Redirect

2008-01-02 Thread Forest Bond
Hi, On Wed, Jan 02, 2008 at 09:35:33AM -0600, James Bennett wrote: > On Jan 2, 2008 8:20 AM, Forest Bond <[EMAIL PROTECTED]> wrote: > > I disagree. Exceptions represent "exceptional situations," not all of > > which are > > necessarily errors. For instance, SystemExit is not really an error,

Re: Raising Http Redirect

2008-01-02 Thread James Bennett
On Jan 2, 2008 9:37 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > If someone tries to save a form, but someone else was faster, > then I want to leave the slower person a message, and redirect him to > the form again. His changes will be lost. Why not return a validation error from the form

Re: Raising Http Redirect

2008-01-02 Thread James Bennett
On Jan 2, 2008 8:20 AM, Forest Bond <[EMAIL PROTECTED]> wrote: > I disagree. Exceptions represent "exceptional situations," not all of which > are > necessarily errors. For instance, SystemExit is not really an error, is it? > What about StopIteration? By that analogy as well, exceptions

Re: Raising Http Redirect

2008-01-02 Thread Thomas Guettler
Am Mittwoch, 2. Januar 2008 11:09 schrieb James Bennett: > On Jan 2, 2008 3:49 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > The HTTP return codes 404 and 500 can be raised with an exception. > > > > That's very handy. Unfortunately a Http Redirect can't be raised. > > Do other django users

Re: Raising Http Redirect

2008-01-02 Thread Forest Bond
On Wed, Jan 02, 2008 at 04:09:43AM -0600, James Bennett wrote: > > On Jan 2, 2008 3:49 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > The HTTP return codes 404 and 500 can be raised with an exception. > > > > That's very handy. Unfortunately a Http Redirect can't be raised. > > Do other

Re: Raising Http Redirect

2008-01-02 Thread James Bennett
On Jan 2, 2008 3:49 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > The HTTP return codes 404 and 500 can be raised with an exception. > > That's very handy. Unfortunately a Http Redirect can't be raised. > Do other django users thing this would be usefull, too? No. Exceptions represent

Raising Http Redirect

2008-01-02 Thread Thomas Guettler
Hi, The HTTP return codes 404 and 500 can be raised with an exception. That's very handy. Unfortunately a Http Redirect can't be raised. Do other django users thing this would be usefull, too? I implemented it myself. But I think something like this should be in django. #responseutils.py