From e2b3c50cf0445ff6d9c4c707f59ce64038d0fbb0 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 22 Feb 2008 05:46:46 +0000 Subject: [PATCH] queryset-refactor: Removed some tuple unpacking in a function signature. This isn't going to be permitted in Python 3, so might as well not use it here. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7144 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/sql/query.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 7b70e4d1b2..fba4a088f0 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -607,16 +607,19 @@ class Query(object): return True return False - def join(self, (lhs, table, lhs_col, col), always_create=False, - exclusions=(), promote=False, outer_if_first=False, nullable=False): + def join(self, connection, always_create=False, exclusions=(), + promote=False, outer_if_first=False, nullable=False): """ - Returns an alias for a join between 'table' and 'lhs' on the given - columns, either reusing an existing alias for that join or creating a - new one. + Returns an alias for the join in 'connection', either reusing an + existing alias for that join or creating a new one. 'connection' is a + tuple (lhs, table, lhs_col, col) where 'lhs' is either an existing + table alias or a table name. The join correspods to the SQL equivalent + of:: - 'lhs' is either an existing table alias or a table name. If - 'always_create' is True, a new alias is always created, regardless of - whether one already exists or not. + lhs.lhs_col = table.col + + If 'always_create' is True, a new alias is always created, regardless + of whether one already exists or not. If 'exclusions' is specified, it is something satisfying the container protocol ("foo in exclusions" must work) and specifies a list of @@ -633,6 +636,7 @@ class Query(object): If 'nullable' is True, the join can potentially involve NULL values and is a candidate for promotion (to "left outer") when combining querysets. """ + lhs, table, lhs_col, col = connection if lhs is None: lhs_table = None is_table = False