From 3dcd435a0eb4380a3846e9c65140df480975687e Mon Sep 17 00:00:00 2001 From: Anssi Kääriäinen Date: Thu, 20 Dec 2012 21:25:48 +0200 Subject: Fixed #19500 -- Solved a regression in join reuse The ORM didn't reuse joins for direct foreign key traversals when using chained filters. For example: qs.filter(fk__somefield=1).filter(fk__somefield=2)) produced two joins. As a bonus, reverse onetoone filters can now reuse joins correctly The regression was caused by the join() method refactor in commit 68847135bc9acb2c51c2d36797d0a85395f0cd35 Thanks for Simon Charette for spotting some issues with the first draft of the patch. --- django/db/models/sql/constants.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'django/db/models/sql/constants.py') diff --git a/django/db/models/sql/constants.py b/django/db/models/sql/constants.py index 1c34f70169..9f82f426ed 100644 --- a/django/db/models/sql/constants.py +++ b/django/db/models/sql/constants.py @@ -44,6 +44,3 @@ ORDER_DIR = { 'ASC': ('ASC', 'DESC'), 'DESC': ('DESC', 'ASC'), } - -# A marker for join-reusability. -REUSE_ALL = object() -- cgit v1.3