diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-02-22 05:46:46 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-02-22 05:46:46 +0000 |
| commit | e2b3c50cf0445ff6d9c4c707f59ce64038d0fbb0 (patch) | |
| tree | 8e026cb8e63d86dc7161750457d940dbfa1283c6 /django/db/models/sql/query.py | |
| parent | 83e00a237158f7961b06abd31c2ed867f1831c3f (diff) | |
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
Diffstat (limited to 'django/db/models/sql/query.py')
| -rw-r--r-- | django/db/models/sql/query.py | 20 |
1 files 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 |
