Fixed #31580 -- Added error messages on distinct() following union(), intersection(), and difference().
This commit is contained in:
parent
49ae7ce50a
commit
01a381cc17
|
@ -1138,6 +1138,7 @@ class QuerySet:
|
|||
"""
|
||||
Return a new QuerySet instance that will select only distinct results.
|
||||
"""
|
||||
self._not_support_combined_queries('distinct')
|
||||
assert not self.query.is_sliced, \
|
||||
"Cannot create distinct fields once a slice has been taken."
|
||||
obj = self._chain()
|
||||
|
|
|
@ -272,6 +272,7 @@ class QuerySetSetOperationTests(TestCase):
|
|||
'annotate',
|
||||
'defer',
|
||||
'delete',
|
||||
'distinct',
|
||||
'exclude',
|
||||
'extra',
|
||||
'filter',
|
||||
|
|
Loading…
Reference in New Issue