#23791: Subqueries with non-"id" OneToOneField primary keys try to join against the wrong column name -------------------------------------+------------------------------------- Reporter: ris | Owner: nobody Type: Bug | Status: closed Component: Database layer | Version: master (models, ORM) | Severity: Normal | Resolution: fixed Keywords: orm primary_key | Triage Stage: Ready for OneToOneField subquery values | checkin Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Tim Graham <timograham@…>):
* status: new => closed * resolution: => fixed Comment: In [changeset:"9ed82154bd0bd01c6195942db84302e791ad366f" 9ed8215]: {{{ #!CommitTicketReference repository="" revision="9ed82154bd0bd01c6195942db84302e791ad366f" Fixed #23791 -- Corrected object type check for pk__in=qs When the pk was a relation field, qs.filter(pk__in=qs) didn't work. In addition, fixed Restaurant.objects.filter(place=restaurant_instance), where place is an OneToOneField and the primary key of Restaurant. A big thank you to Josh for review and to Tim for review and cosmetic edits. Thanks to Beauhurst for commissioning the work on this ticket. }}} -- Ticket URL: <https://code.djangoproject.com/ticket/23791#comment:5> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/061.bed41f90ba04e7c6691194366c2275d9%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.