Skip to content

Commit

Permalink
Merge pull request #156 from svleeuwen/patch-1
Browse files Browse the repository at this point in the history
Fix Pickle exception when polymorphic model is cached
  • Loading branch information
vdboor committed Oct 1, 2015
2 parents f4898c3 + ed55ceb commit fdf905d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions polymorphic/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ class self.model, but as a class derived from self.model. We want to re-fetch

# set polymorphic_annotate_names in all objects (currently just used for debugging/printing)
if self.query.aggregates:
annotate_names = six.iterkeys(self.query.aggregates) # get annotate field list
annotate_names = list(six.iterkeys(self.query.aggregates)) # get annotate field list
for real_object in resultlist:
real_object.polymorphic_annotate_names = annotate_names

# set polymorphic_extra_select_names in all objects (currently just used for debugging/printing)
if self.query.extra_select:
extra_select_names = six.iterkeys(self.query.extra_select) # get extra select field list
extra_select_names = list(six.iterkeys(self.query.extra_select)) # get extra select field list
for real_object in resultlist:
real_object.polymorphic_extra_select_names = extra_select_names

Expand Down

0 comments on commit fdf905d

Please sign in to comment.