#24710: Replace BaseForm.errors property with get_errors method
-----------------------------+--------------------------------------
     Reporter:  artemrizhov  |                    Owner:  nobody
         Type:  Bug          |                   Status:  new
    Component:  Forms        |                  Version:  1.7
     Severity:  Normal       |               Resolution:
     Keywords:               |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+--------------------------------------
Changes (by artemrizhov):

 * needs_docs:   => 0
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Old description:

> This is not a real bug, but this makes some problems. I think property
> getter should not do so much changes into the internal state of the
> object. This getter calls the `full_clean` method, so this is actually
> not a getter, but a real '''worker'''.
>
> This also produces very annoying side effects on debugging which really
> look and work like a bug. Please see this stackoverflow question for
> example
> http://stackoverflow.com/questions/12142819/debugging-form-validation-in-
> pycharm
> (sorry for the link to third-party resource, please let me know if you
> think this text should be copied here)
>
> I propose to replace `errors` property with `get_errors` method so that
> * anybody can see it does some work to retrieve the errors
> * debuggers do not try to evaluate it
> * developers do not spend hours for catching non-existent bugs in their
> apps :)

New description:

 This is not a real bug, but it makes some problems. Some kind of
 Schrödinger's bug.

 I think property getter should not do so much changes into the internal
 state of the object. This getter calls the `full_clean` method, so this is
 actually not a getter, but a real '''worker'''.

 This also produces very annoying side effects on debugging which really
 look and work like a bug. Please see this stackoverflow question for
 example
 http://stackoverflow.com/questions/12142819/debugging-form-validation-in-
 pycharm
 (sorry for the link to third-party resource, please let me know if you
 think this text should be copied here)

 I propose to replace `errors` property with `get_errors` method so that
 * anybody can see it does some work to retrieve the errors
 * debuggers do not try to evaluate it
 * developers do not spend hours for catching non-existent bugs in their
 apps :)

--

--
Ticket URL: <https://code.djangoproject.com/ticket/24710#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.382de02e05998d51f8336f6facf10b9d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to