django/django — pull request #495 by aisipos (2012-11-04 23:45:23+00:00)
Title: Fixed #18949 -- Improve performance of model_to_dict with many-to-many

Link to trac ticket:
https://code.djangoproject.com/ticket/18949

When calling model_to_dict, improve performance of the generated SQL by
using values_list to determine primary keys of many to many objects. Add
a specific test for this function, test_model_to_dict_many_to_many

Thanks to brian for the original report and suggested fix.