Opened 18 years ago
Closed 18 years ago
#4130 closed (fixed)
When mistyping a field name in an ORM call, the error message could be a lot more helpful.
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If I make a mistake when creating a filter call, the error message simply says, "Cannot resolve keyword 'pollls' into field".
More helpful is to show what the possible fields are: "Cannot resolve keyword 'pollls' into field, choices are: polls, cats, dogs"
Attached is a patch that changes the message in this way.
Attachments (3)
Change History (9)
by , 18 years ago
Attachment: | patch_field_choices.txt added |
---|
comment:1 by , 18 years ago
Summary: | When mistyping a field name in an ORM call, the error message could be a lot more helpful. → [patch] When mistyping a field name in an ORM call, the error message could be a lot more helpful. |
---|
comment:2 by , 18 years ago
Has patch: | set |
---|---|
Summary: | [patch] When mistyping a field name in an ORM call, the error message could be a lot more helpful. → When mistyping a field name in an ORM call, the error message could be a lot more helpful. |
anonymous: Please don't change titles to include the word [patch]. It wastes space. We have a checkbox for that purpose (indicating patches, not wasting space).
comment:3 by , 18 years ago
Needs tests: | set |
---|
FYI there are a couple of tests in tests/modeltests/lookup/models.py that test for this error message. They will need to be changed if the error message changes.
by , 18 years ago
Attachment: | patch_field_choices_tests.txt added |
---|
A second patch, fixing the tests.
comment:4 by , 18 years ago
Needs tests: | unset |
---|
by , 18 years ago
Attachment: | field_choices.patch added |
---|
updated patch to trunk, fixed paths in test patch, combined both
comment:5 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The patch!