mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #24267 -- Implemented lookups for related fields
Previously related fields didn't implement get_lookup, instead related fields were treated specially. This commit removed some of the special handling. In particular, related fields return Lookup instances now, too. Other notable changes in this commit is removal of support for annotations in names_to_path().
This commit is contained in:
committed by
Tim Graham
parent
8654c6a732
commit
b68212f539
@@ -3678,3 +3678,11 @@ class TestTicket24279(TestCase):
|
||||
School.objects.create()
|
||||
qs = School.objects.filter(Q(pk__in=()) | Q())
|
||||
self.assertQuerysetEqual(qs, [])
|
||||
|
||||
|
||||
class TestInvalidValuesRelation(TestCase):
|
||||
def test_invalid_values(self):
|
||||
with self.assertRaises(ValueError):
|
||||
Annotation.objects.filter(tag='abc')
|
||||
with self.assertRaises(ValueError):
|
||||
Annotation.objects.filter(tag__in=[123, 'abc'])
|
||||
|
||||
Reference in New Issue
Block a user