#14196: Objects that come from something_set, should have their parent object
filled in
-------------------------------------+-------------------------------------
     Reporter:  mark0978             |                    Owner:  zedr
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

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>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.451725e90f267b7ae59f6a91c4b2e09f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to