Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #16472 -- Removed stale code in the query code. Thanks, fva@cht…

…d.org.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16562 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 50ed810c1ffcda2432cf1417d739a98c78f572b1 1 parent 643239e
Jannis Leidel authored July 29, 2011

Showing 1 changed file with 0 additions and 5 deletions. Show diff stats Hide diff stats

  1. 5  django/db/models/query.py
5  django/db/models/query.py
@@ -226,7 +226,6 @@ def iterator(self):
226 226
         only_load = self.query.get_loaded_field_names()
227 227
         if not fill_cache:
228 228
             fields = self.model._meta.fields
229  
-            pk_idx = self.model._meta.pk_index()
230 229
 
231 230
         load_fields = []
232 231
         # If only/defer clauses have been specified,
@@ -235,9 +234,6 @@ def iterator(self):
235 234
             for field, model in self.model._meta.get_fields_with_model():
236 235
                 if model is None:
237 236
                     model = self.model
238  
-                if field == self.model._meta.pk:
239  
-                    # Record the index of the primary key when it is found
240  
-                    pk_idx = len(load_fields)
241 237
                 try:
242 238
                     if field.name in only_load[model]:
243 239
                         # Add a field that has been explicitly included
@@ -276,7 +272,6 @@ def iterator(self):
276 272
             else:
277 273
                 if skip:
278 274
                     row_data = row[index_start:aggregate_start]
279  
-                    pk_val = row_data[pk_idx]
280 275
                     obj = model_cls(**dict(zip(init_list, row_data)))
281 276
                 else:
282 277
                     # Omit aggregates in object creation.

0 notes on commit 50ed810

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