Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#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 Malcolm Tredinnick, 13 years ago

Resolution: wontfix
Status: newclosed

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.

comment:2 by Marc Tamlyn, 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.
Back to Top