fix select_related bug for objects from derived classes (till now sel.-r. was just ignored)
parent
2a740e9b10
commit
2e17a184c0
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue