#10127: select_related does not play well with annotate
---------------------------------------------------+------------------------
Reporter: [email protected] | Owner: nobody
Status: reopened | Milestone:
Component: Database layer (models, ORM) | Version: SVN
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by Sylvain Pasche <[email protected]>):
* status: closed => reopened
* resolution: fixed =>
Comment:
Thanks for the fix. There is still an issue when using both
select_related and annotate. The !ForeignKey fields are not populated
correctly.
With the attached patch, I'm getting the following error (which does not
happen when I remove the select_related()):
{{{
File "[...]aggregation_regress\models.py", line ?, in
regressiontests.aggregation_regress.models.__test__.API_TESTS
Failed example:
sorted([b.publisher.name for b in books])
Expected:
[u'Apress', u'Prentice Hall', u'Prentice Hall', u'Sams']
Got:
[1L, 2L, 3L, 3L]
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/10127#comment:6>
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
-~----------~----~----~----~------~----~------~--~---