James Bennett wrote:
> On 8/24/06, JP <[EMAIL PROTECTED]> wrote:
> > I like James Bennetts's example a lot, but I'd like it more if the form
> > class were ModelForm, descending from a more general Form class that
> > would look much like the base Manipulator class of today.
>
> I think you're confusing me with someone else...

Sorry! I mixed up Joseph, who was quoted in Adrian's email, with your
first reply to the message with the quote. Apologies to James and
Joseph for the misattribution. I still like the ideas. :)

> > I'm afraid that I find the idea in Brantley Harris's proposal of
> > raising a Form as an exception as a form of flow control really
> > counter-intuitive. Apologies and it's just my opinion of course, but it
> > has a sort of  "too clever" feel to me. Also, exceptions are very
> > expensive, and I don't see the practical benefits of that usage pattern
> > over something like:
>
> The benefit, as I see it, is that it's much simpler and much more
> descriptive of what's actually going on; you've got some data, you're
> trying to save an object from it. Which, logically, translates into a
> try/except block around the form's 'save' method; that makes the code
> crystal-clear on what you're actually trying to do.

All I can say is that I don't see it that way. For me, raising the form
as an exception (or an exception referencing the form) seems unnatural
and unintuitive, and much less explicit, readable, etc, than just
dealing with the flow of form validation and saving in the same way
that Manipulators do now. And it ignores the many uses of forms that
don't involve binding a form to single model that validates and saves
the form input. I don't think that the view-manipulator interaction is
broken, and I think it can be easily adapted to handle model-driven
validation and saving, as in Joseph's sample code.

So count me as -1 on using exceptions for form processing control, for
whatever that's worth.

JP


--~--~---------~--~----~------------~-------~--~----~
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