#3358: select_related() and selecting by db table fields
---------------------------------------------+------------------------------
Reporter: dbr <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component: Database
wrapper
Version: 0.95 | Resolution:
Keywords: | Stage: Design
decision needed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------------+------------------------------
Comment (by dbr <[EMAIL PROTECTED]>):
[http://www.nabble.com/using-select_related%28%29-and-selecting-DB-table-
fields-tf3058842.html The thread] on django-developers contain of nothing
more than my post, unfortunately.
My idea was using a !ValueQuerySet, or some variant of it. The only real
difference is that it gets properly filled through the join.
If I try using the model with values() and select_related() this is what
happens:
{{{
>>> Trackback.objects.select_related().values('blog', 'title')
[{'blog': 1L, 'title': 'Tracback entry'}, {'blog': 3L, 'title': 'Trackback
entry 2'}]
}}}
.. so I'm getting the key and not the Blog model object I expected in the
!ValueQuerySet.
--
Ticket URL: <http://code.djangoproject.com/ticket/3358#comment:2>
Django Code <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
-~----------~----~----~----~------~----~------~--~---