* owner: nobody => zedr
* status: new => assigned
Comment:
Assigning to myself for work.
--
Ticket URL: <https://code.djangoproject.com/ticket/14196#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by zedr):
I cannot reproduce this using the following test:
{{{
def test_prepopulated_parent_of_a_set(self):
my_user = User.objects.create(username="MyUser")
LogEntry.objects.create(user=my_user, action_flag=0)
user_logs = my_user.logentry_set.all()
first_log = user_logs[0]
with self.assertNumQueries(0):
log_user = first_log.user
self.assertEquals(my_user.username, log_user.username)
}}}
This test passes, meaning no additional queries were executed when
attempting to lookup the parent user. Maybe I'm missing something obvious?
--
Ticket URL: <https://code.djangoproject.com/ticket/14196#comment:6>
* status: assigned => new
* owner: zedr =>
--
Ticket URL: <https://code.djangoproject.com/ticket/14196#comment:7>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/14196#comment:8>
Comment (by carljm):
Thanks for investigating!
--
Ticket URL: <https://code.djangoproject.com/ticket/14196#comment:9>
Comment (by mark0978):
I'm betting over the course of the last 5 years this got fixed. Might be
a good idea to add the test code to prevent regression though.
--
Ticket URL: <https://code.djangoproject.com/ticket/14196#comment:10>
Comment (by aaugustin):
`known_related_objects.tests.ExistingRelatedInstancesTests.test_foreign_key`
tests this.
I couldn't find easily when it was introduced because the
modeltests/regressiontests merge breaks git log.
--
Ticket URL: <https://code.djangoproject.com/ticket/14196#comment:11>