{"push_id":590136233,"size":1,"distinct_size":1,"ref":"refs/heads/patch-1","head":"b0c4907d12b39246a2efd334ff0f8fc3527e370b","before":"1c0f66f371a3786d0e90950faf66aa9e462b2aef","commits":[{"sha":"b0c4907d12b39246a2efd334ff0f8fc3527e370b","author":{"email":"3ca62a2ad87376be2697209a1770e1afdbbba220@purplebit.com","name":"eliyahen1"},"message":"Fix ordering of inner prefetch related lookups\n\nInner prefetch related lookups were shifted to all_lookups (in prefetch_related_objects function) in reverse order.\r\nFix shifts them in the correct order.\r\n\r\nAssume this model diagram:\r\nA -(m2m)-> B -(m2m)-> C -(m2m)-> D\r\nNow have this code:\r\nA.objects.prefetch_related(\r\n    'B',\r\n    queryset=B.objects.prefetch_related(\r\n        Prefetch(\r\n            'C',\r\n            to_attr='myC'\r\n        ),\r\n        'myC__D'\r\n    )\r\n)\r\n\r\nall_lookups will have ['B__myC__D', 'B__myC']. The B prefix is after normalizing.\r\nBut the correct order should be ['B__myC', 'B__myC__D'].\r\n\r\nAlso see https://docs.python.org/2/library/collections.html#collections.deque.extendleft :\r\n\"Note, the series of left appends results in reversing the order of elements in the iterable argument.\"","distinct":true,"url":"https://api.github.com/repos/eliyahen1/django/commits/b0c4907d12b39246a2efd334ff0f8fc3527e370b"}]}