Opened 11 years ago
Last modified 11 years ago
#24710 closed Bug
Replace BaseForm.errors property with get_errors method — at Initial Version
| Reported by: | Artem Rizhov | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | 1.7 |
| Severity: | Normal | Keywords: | |
| Cc: | artem.rizhov@… | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
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 :)