On 8/24/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> I think the piece on which I agree with JP is that a _form_ serving as
> an exception is counter-intuitive. I would prefer an exception to be an
> error dict that is then used to display them.

I'm not so sure about that. The form itself was the thing that was
"bad" and needs to be dealt with, so why *shouldn't* it be the
exception?

> Consider a form working over Ajax. In most cases you don't want to
> redisplay the whole form with errors but give out just errors serialized
> as JSON or XML.

try:
    p = poll_form.save(poll_data)
    return HttpResponse(simplejson.dumps(p), mimetype="application/javascript")
except Form, form:
    return HttpResponse(simplejson.dumps(form),
mimetype="application/javascript")

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to