mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #19187 -- Raise consistent error from qs.values().delete()
This commit is contained in:
@@ -983,6 +983,12 @@ class ValuesQuerySet(QuerySet):
|
||||
for row in self.query.get_compiler(self.db).results_iter():
|
||||
yield dict(zip(names, row))
|
||||
|
||||
def delete(self):
|
||||
# values().delete() doesn't work currently - make sure it raises an
|
||||
# user friendly error.
|
||||
raise TypeError("Queries with .values() or .values_list() applied "
|
||||
"can't be deleted")
|
||||
|
||||
def _setup_query(self):
|
||||
"""
|
||||
Constructs the field_names list that the values query will be
|
||||
|
||||
Reference in New Issue
Block a user