Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for modelclass, idlist in idlist_per_model.items():
- qs = modelclass.base_objects.filter(id__in=idlist)
- qs.dup_select_related(self) # copy select related configuration to new qs
- for o in qs:
- + if type(o.pk) != type(o.id):
- + o.pk=o.id
- +
- if self.query.aggregates:
- for anno_field_name in self.query.aggregates.keys():
- attr = getattr(base_result_objects_by_id[o.pk], anno_field_name)
- setattr(o, anno_field_name, attr)
Add Comment
Please, Sign In to add comment