#2520 closed defect (fixed)
[patch] Invalid SQL generated when searching, using Foreign Keys in ordering but not in searching
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | |
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
A ProgrammingError, missing FROM-clause entry is generated in the following specific conditions:
- A Foreign Key is used in model.Meta.ordering
- The Foreign Key is NOT in the model.Admin.search_fields
- You perform a search.
The JOIN is not made with the Foreign Key, but it is listed in the ORDER BY clause.
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | django_admin_change_list_order_bug.diff added |
---|
comment:1 by , 18 years ago
Summary: | Invalid SQL generated when searching, using Foreign Keys in ordering but not in searching → [patch] Invalid SQL generated when searching, using Foreign Keys in ordering but not in searching |
---|
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Fixed #2520.