commit 893caaaad91dee42e6bd717f3745f60a9c89def7
Author: Jonas Haag <jonas@lophus.org>
Date: Wed Sep 28 21:42:54 2011 +0200
supports_select_related
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index dd24878..f2bde84 100644
|
a
|
b
|
class BaseDatabaseFeatures(object):
|
| 313 | 313 | has_select_for_update = False |
| 314 | 314 | has_select_for_update_nowait = False |
| 315 | 315 | |
| | 316 | supports_select_related = True |
| | 317 | |
| 316 | 318 | # Does the default test database allow multiple connections? |
| 317 | 319 | # Usually an indication that the test database is in-memory |
| 318 | 320 | test_db_allows_multiple_connections = True |
diff --git a/django/db/models/query.py b/django/db/models/query.py
index be42d02..3ac8be4 100644
|
a
|
b
|
class QuerySet(object):
|
| 232 | 232 | An iterator over the results from applying this QuerySet to the |
| 233 | 233 | database. |
| 234 | 234 | """ |
| 235 | | fill_cache = self.query.select_related |
| | 235 | fill_cache = False |
| | 236 | if connections[self.db].features.supports_select_related: |
| | 237 | fill_cache = self.query.select_related |
| 236 | 238 | if isinstance(fill_cache, dict): |
| 237 | 239 | requested = fill_cache |
| 238 | 240 | else: |