Navigation Menu

Skip to content

Commit

Permalink
Fixed #16472 -- Removed stale code in the query code. Thanks, fva@cht…
Browse files Browse the repository at this point in the history
…d.org.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16562 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jezdez committed Jul 29, 2011
1 parent 643239e commit 50ed810
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions django/db/models/query.py
Expand Up @@ -226,7 +226,6 @@ def iterator(self):
only_load = self.query.get_loaded_field_names() only_load = self.query.get_loaded_field_names()
if not fill_cache: if not fill_cache:
fields = self.model._meta.fields fields = self.model._meta.fields
pk_idx = self.model._meta.pk_index()


load_fields = [] load_fields = []
# If only/defer clauses have been specified, # If only/defer clauses have been specified,
Expand All @@ -235,9 +234,6 @@ def iterator(self):
for field, model in self.model._meta.get_fields_with_model(): for field, model in self.model._meta.get_fields_with_model():
if model is None: if model is None:
model = self.model model = self.model
if field == self.model._meta.pk:
# Record the index of the primary key when it is found
pk_idx = len(load_fields)
try: try:
if field.name in only_load[model]: if field.name in only_load[model]:
# Add a field that has been explicitly included # Add a field that has been explicitly included
Expand Down Expand Up @@ -276,7 +272,6 @@ def iterator(self):
else: else:
if skip: if skip:
row_data = row[index_start:aggregate_start] row_data = row[index_start:aggregate_start]
pk_val = row_data[pk_idx]
obj = model_cls(**dict(zip(init_list, row_data))) obj = model_cls(**dict(zip(init_list, row_data)))
else: else:
# Omit aggregates in object creation. # Omit aggregates in object creation.
Expand Down

0 comments on commit 50ed810

Please sign in to comment.