mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
queryset-refactor: Fixed the optimization that potentially removes the final
join to handle the case where a to_field attribute is given for the join. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6495 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -128,19 +128,15 @@ Bug #2253
|
||||
>>> (q1 & q2).order_by('name')
|
||||
[<Item: one>]
|
||||
|
||||
Bugs #4088 & #4306
|
||||
Bugs #4088, #4306
|
||||
>>> Report.objects.filter(creator=1001)
|
||||
[<Report: r1>]
|
||||
>>> Report.objects.filter(creator__num=1001)
|
||||
[<Report: r1>]
|
||||
|
||||
# FIXME: The "removing final pk comparison" optimization is biting us here.
|
||||
# Need to only remove it if the join was also on the pk value.
|
||||
# >>> Report.objects.filter(creator__id=1001)
|
||||
# []
|
||||
# >>> Report.objects.filter(creator__id=a1.id)
|
||||
# [<Report: r1>]
|
||||
|
||||
>>> Report.objects.filter(creator__id=1001)
|
||||
[]
|
||||
>>> Report.objects.filter(creator__id=a1.id)
|
||||
[<Report: r1>]
|
||||
>>> Report.objects.filter(creator__name='a1')
|
||||
[<Report: r1>]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user