On Mon, 2007-09-17 at 10:14 +0200, Christopher Lenz wrote:
> Am 17.09.2007 um 04:17 schrieb Malcolm Tredinnick:
> > On Mon, 2007-09-17 at 00:23 +0200, Christopher Lenz wrote:
> >> Hey all,
> >>
> >> I've created a ticket which has been closed as wontfix, and was told
> >> to bring it here. So here I am.
> >>
> >>    <http://code.djangoproject.com/ticket/5153>
> >
> > I'm somewhere between -0 and -1 on this, for a couple of reasons. I
> > don't like the design and you can achieve the same functionality  
> > without
> > any changes to core. Explanations below...
> >
> > [...]
> >> Now, that use case may sound crazy to you (I don't know why it would,
> >> but hey). But the point is that there is currently NO WAY to do this
> >> with newforms. Honestly, the design of newforms.Form.clean(), where
> >> it deletes its own "cleaned_data" attribute as soon as there's a
> >> single validation error, is totally backwards and unpythonic. There
> >> should be *some* way to get at the cleaned_data values, even if some
> >> of the fields failed to validate.
> >
> > If that was how the code worked, you would have a point. However,
> > Form.full_clean() fills cleaned_data with the normalised forms of any
> > fields that validated and puts any errors into the internal error  
> > list.
> > So fields that are correct *do* appear in cleaned_data and it is not
> > erased when an error is encountered.
> 
> Um, yes they are erased:
> 
>    <http://code.djangoproject.com/browser/django/trunk/django/ 
> newforms/forms.py#L205>
> 
> Am I missing something?

My mistake. Apologies.

That might be something to look into fixing.

I still not keen on the idea of being able to disable validation, since
it's the driving feature behind clean() (which is my problem with the
design, as opposed to the implementation issues). I want to think about
this some more.

Malcolm

-- 
What if there were no hypothetical questions? 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to