fix select_related bug for objects from derived classes (till now sel.-r. was just ignored)

fix_request_path_info
Bert Constantin 2010-02-02 07:28:29 +01:00
parent 2a740e9b10
commit 2e17a184c0
1 changed files with 1 additions and 2 deletions

View File

@ -150,8 +150,7 @@ class PolymorphicQuerySet(QuerySet):
for modelclass, idlist in idlist_per_model.items(): for modelclass, idlist in idlist_per_model.items():
qs = modelclass.base_objects.filter(id__in=idlist) qs = modelclass.base_objects.filter(id__in=idlist)
# copy select related configuration to new qs # copy select related configuration to new qs
# TODO: this does not seem to copy the complete sel_rel-config (field names etc.) qs.dup_select_related(self)
self.dup_select_related(qs)
# TODO: defer(), only() and annotate(): support for these would be around here # TODO: defer(), only() and annotate(): support for these would be around here
for o in qs: results[o.id] = o for o in qs: results[o.id] = o