Skip to content

Instantly share code, notes, and snippets.

@hrehfeld
Created April 29, 2012 10:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hrehfeld/2549147 to your computer and use it in GitHub Desktop.
--- db/models/sql/query_org.py 2012-04-29 12:06:48.798119638 +0200
+++ db/models/sql/query.py 2012-04-29 12:04:20.155210307 +0200
@@ -1753,7 +1753,12 @@
certain related models (as opposed to all models, when
self.select_related=True).
"""
- field_dict = {}
+ if self.select_related is False:
+ field_dict = {}
+ else:
+ field_dict = self.select_related
for field in fields:
d = field_dict
for part in field.split(LOOKUP_SEP):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment