Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17335 -- Added supports_select_related hook for django-nonrel.…

… Thanks, jonash

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5f9dbef4bb5d8b9f077cd6a01b5e554f6dfb4f19 1 parent 33bb3cd
Adrian Holovaty authored December 05, 2011
2  django/db/backends/__init__.py
@@ -313,6 +313,8 @@ 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
4  django/db/models/query.py
@@ -232,7 +232,9 @@ def iterator(self):
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:

0 notes on commit 5f9dbef

Please sign in to comment.
Something went wrong with that request. Please try again.