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:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user