#16707 closed Cleanup/optimization (wontfix)
Form.is_valid should be a property.
Reported by: | Marc Tamlyn | Owned by: | Marc Tamlyn |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Reasoning: It depends on a property (Form.errors) which is where the work happens. Calling Form.is_valid() twice doesn't validate the form twice. It seems a similar situation to HttpRequest.is_ajax.
See pull request here: https://github.com/django/django/pull/35
Change History (2)
comment:1 by , 13 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Fair point. It would be a faff to make it backwards compatible. I'll withdraw the pull req. too.
Note:
See TracTickets
for help on using tickets.
This would be backwards incompatible. The
is_valid()
function is part of the public API. There's no strong disadvantage to it being a method call in any case, so let's not over-think it.