summaryrefslogtreecommitdiff
path: root/django/db/models/utils.py
diff options
context:
space:
mode:
authorTakayuki Hirayama <hirayama@atama.plus>2021-06-04 00:32:55 +0900
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-06-04 07:23:16 +0200
commit0393b9262dcf1b8302d35a8a470e14837ca1300b (patch)
tree3a455c3a9dad1f709b8da909cfc6def3fe25a697 /django/db/models/utils.py
parentf10c52afabac25f2c10aca26d32dbe7e0e46082e (diff)
downloaddjango-0393b9262dcf1b8302d35a8a470e14837ca1300b.tar.gz
Fixed #32812 -- Restored immutability of named values from QuerySet.values_list().
Regression in 981a072dd4dec586f8fc606712ed9a2ef116eeee. Thanks pirelle for the report.
Diffstat (limited to 'django/db/models/utils.py')
-rw-r--r--django/db/models/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/models/utils.py b/django/db/models/utils.py
index 764ca5888b..a8bd20fba7 100644
--- a/django/db/models/utils.py
+++ b/django/db/models/utils.py
@@ -45,4 +45,8 @@ def create_namedtuple_class(*names):
def __reduce__(self):
return unpickle_named_row, (names, tuple(self))
- return type('Row', (namedtuple('Row', names),), {'__reduce__': __reduce__})
+ return type(
+ 'Row',
+ (namedtuple('Row', names),),
+ {'__reduce__': __reduce__, '__slots__': ()},
+ )