[1.7.x] Fixed #23578 -- Changed examples in docs to use patterns
[1.7.x] Added flat=False to signature of QuerySet.values_list()

Backport of 20f868bc5a from master