1
0
mirror of https://github.com/django/django.git synced 2025-10-29 16:46:11 +00:00

Refs #31044 -- Fixed error message when using Prefetch with a values_list() queryset.

This commit is contained in:
Mariusz Felisiak
2019-12-09 15:32:09 +01:00
parent 4540842bc3
commit d6505273cd
2 changed files with 6 additions and 3 deletions

View File

@@ -1541,7 +1541,8 @@ class Prefetch:
)
):
raise ValueError(
'Prefetch querysets cannot use raw() and values().'
'Prefetch querysets cannot use raw(), values(), and '
'values_list().'
)
if to_attr:
self.prefetch_to = LOOKUP_SEP.join(lookup.split(LOOKUP_SEP)[:-1] + [to_attr])