mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +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:
parent
8654c6a732
commit
b68212f539
6 changed files with 219 additions and 94 deletions
|
@ -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'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue