raises
{{{
File "/home/markus/src/django/django/db/models/sql/query.py", line 1181,
in build_filter
lookups, value)
File "/home/markus/src/django/django/db/models/fields/related.py", line
1514, in get_lookup_constraint
raise exceptions.FieldError('Relation fields do not support nested
lookups')
FieldError: Relation fields do not support nested lookups
}}}
Which is very confusing. Is a better error message possible?
(This might have been the original cause of #23351.)
--
Ticket URL: <https://code.djangoproject.com/ticket/23697>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
Better error messages are always welcome. I believe we could throw away
the current error message and instead tell the user which fields are
available. This would match pre-1.7 error message.
--
Ticket URL: <https://code.djangoproject.com/ticket/23697#comment:1>
* type: Uncategorized => Cleanup/optimization
* component: Uncategorized => Database layer (models, ORM)
--
Ticket URL: <https://code.djangoproject.com/ticket/23697#comment:2>
Comment (by charettes):
#23351 was a duplicate which manifested itself in the admins
`search_fields` references.
--
Ticket URL: <https://code.djangoproject.com/ticket/23697#comment:3>
* status: new => assigned
* owner: nobody => exonian
--
Ticket URL: <https://code.djangoproject.com/ticket/23697#comment:4>
* has_patch: 0 => 1
Comment:
https://github.com/django/django/pull/4375
--
Ticket URL: <https://code.djangoproject.com/ticket/23697#comment:5>
* stage: Accepted => Ready for checkin
Comment:
Looks good.
--
Ticket URL: <https://code.djangoproject.com/ticket/23697#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"00e667728ba3ef1b5cb3de0e11c7648b89315a91" 00e66772]:
{{{
#!CommitTicketReference repository=""
revision="00e667728ba3ef1b5cb3de0e11c7648b89315a91"
Fixed #23697 -- Improved ForeignObject.get_lookup_constraint() error
message.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23697#comment:7>