Hi Carl,

On Thu, Jul 3, 2014 at 5:33 AM, Carl Meyer <[email protected]> wrote:

> On 06/27/2014 06:41 AM, Russell Keith-Magee wrote:
> >
> > On Fri, Jun 27, 2014 at 7:35 PM, Curtis Maloney
> > <[email protected] <mailto:[email protected]>> wrote:
> >
> >     Am I reading this right as "people used to commonly solve this
> >     problem by using an internal API, but now we have a public one...
> >     AND the old internal API is now changed"?
> >
> >     If so, the solution seems obvious -- document that it's time to move
> >     the the official solution :)
> >
> >
> > Broadly speaking, I agree. However, my hesitation in categorically
> > agreeing stems from the fact that ValidationError *is* public API. Or,
> > at least, the constructor is, - but it seems a little absurd that we
> > formally document a way for people to construct an object, but not to
> > support any of the ways that they might have *used* that object.
>
> I don't think there's any absurdity. The documented and supported way to
> "use" ValidationError has always been to simply raise it from a clean()
> or clean_field() method, in which case Django itself catches it. Calling
> other undocumented methods on it it is clearly making use of unsupported
> internal API.
>

Sure - I can appreciate that argument. However, on the other side - the use
case I've described isn't completely left field, and a github code search
shows that update_error_dict() is being used in the wild for exactly that
reason.

That said - the discussion on the ticket and related PRs indicates that
restructuring necessary to make form.add_error() work mean that there
probably isn't a path that will allow backwards compatibility, so the
argument is moot at this point. The new add_error() API is much nicer, and
it isn't that hard to convert update_error_dict() usage into add_error()
usage, so I suppose we'll have to live with this upgrade wart.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAJxq84-FrbK5Q2_DhPsKP5%2B%3D_dUthuU%2BunTitzjf87gBhxGerw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to