From 93baa3e4170ea40be967d48560ffca55395be07b Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 15 Mar 2008 09:13:22 +0000 Subject: queryset-refactor: Optimised some internal data structures in sql/query.py. Mostly this involves changing them to a "copy on write" implementation, which speeds up cloning (and the relevant structures aren't updated very frequently). git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7247 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/queries/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/regressiontests') diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py index 7185558f45..a9783569a7 100644 --- a/tests/regressiontests/queries/models.py +++ b/tests/regressiontests/queries/models.py @@ -205,7 +205,7 @@ Bug #1801 Bug #2306 Checking that no join types are "left outer" joins. >>> query = Item.objects.filter(tags=t2).query ->>> query.LOUTER not in [x[2][2] for x in query.alias_map.values()] +>>> query.LOUTER not in [x[2] for x in query.alias_map.values()] True >>> Item.objects.filter(Q(tags=t1)).order_by('name') @@ -332,12 +332,12 @@ Bug #5324, #6704 # Excluding from a relation that cannot be NULL should not use outer joins. >>> query = Item.objects.exclude(creator__in=[a1, a2]).query ->>> query.LOUTER not in [x[2][2] for x in query.alias_map.values()] +>>> query.LOUTER not in [x[2] for x in query.alias_map.values()] True Similarly, when one of the joins cannot possibly, ever, involve NULL values (Author -> ExtraInfo, in the following), it should never be promoted to a left outer join. So hte following query should only involve one "left outer" join (Author -> Item is 0-to-many). >>> qs = Author.objects.filter(id=a1.id).filter(Q(extra__note=n1)|Q(item__note=n3)) ->>> len([x[2][2] for x in qs.query.alias_map.values() if x[2][2] == query.LOUTER]) +>>> len([x[2] for x in qs.query.alias_map.values() if x[2] == query.LOUTER]) 1 The previous changes shouldn't affect nullable foreign key joins. -- cgit v1.3