Ticket #26515: ForeignObject_from_fields__bug_26515.patch

File ForeignObject_from_fields__bug_26515.patch, 745 bytes (added by darius, 9 years ago)

patch that keep order of targets in trim_joins

  • django/db/models/sql/query.py

    <+>UTF-8
     
    14411441            cur_targets = set(t.column for t in targets)
    14421442            if not cur_targets.issubset(join_targets):
    14431443                break
    1444             targets = tuple(r[0] for r in info.join_field.related_fields if r[1].column in cur_targets)
     1444            targets_dict = {r[1].column: r[0] for r in info.join_field.related_fields if r[1].column in cur_targets}
     1445            targets = tuple(targets_dict[t.column] for t in targets)
    14451446            self.unref_alias(joins.pop())
    14461447        return targets, joins[-1], joins
    14471448
Back to Top