#14056: Wrong query generated when using reverse foreign key
---------------------------------------------------+------------------------
Reporter: premalshah | Owner: nobody
Status: new | Milestone: 1.3
Component: Database layer (models, ORM) | Version: SVN
Resolution: | Keywords: foreign
key, reverse lookup
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by accuser):
* keywords: foreign key => foreign key, reverse lookup
* has_patch: 0 => 1
* version: 1.0 => SVN
Comment:
Got an idea, that trim optimization of the join, which has been got by the
simple reverse relation, -- is incorrect, because first "real table"
doesn't contain any relation to second one, so it can't get sought-for
field value.
Will attach possible straight-forward solution with tests in the next
comment.
I'm not sure of this ticket is related to #11319. It seems that `to_field`
attribute is partially broken.
--
Ticket URL: <http://code.djangoproject.com/ticket/14056#comment:10>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.