#3470: related data injection for related managers
-----------------------------------------------------------+----------------
Reporter: Ronny Pfannschmidt <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component:
Metasystem
Version: SVN | Keywords:
Stage: Unreviewed | Has_patch: 0
-----------------------------------------------------------+----------------
it would be nice, of querysets injected objects where used as query
parameters to the result set
example using the polls app from the tutorial
{{{
#!python
from polls.models import *
from django.db import connection
Poll.objects.get(id=1).choice_set.all()[0].poll
}}}
results in 3 queries, since the related manager wont pass the orginal poll
object to the instances of the choices
after this code connection.queries is
{{{
#!python
[
{'time': '0.000',
'sql': 'SELECT
"polls_poll"."id","polls_poll"."question","polls_poll"."pub_date" FROM
"polls_poll" WHERE ("polls_poll"."id" = 1)'},
{'time': '0.000',
'sql': 'SELECT
"polls_choice"."id","polls_choice"."poll_id","polls_choice"."choice","polls_choice"."votes"
FROM "polls_choice" WHERE ("polls_choice"."poll_id" = 1) LIMIT 1 '},
{'time': '0.000',
'sql': 'SELECT
"polls_poll"."id","polls_poll"."question","polls_poll"."pub_date" FROM
"polls_poll" WHERE ("polls_poll"."id" = 1)'}]
}}}
the same query twice just cause a python object doesn't get passed
--
Ticket URL: <http://code.djangoproject.com/ticket/3470>
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
-~----------~----~----~----~------~----~------~--~---