mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #10153: foreign key gte
and lte
lookups now work. Thanks, joelhooks and adurdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bfdb7d26aa
commit
fb9ac5729d
2 changed files with 17 additions and 1 deletions
16
tests/regressiontests/model_regress/tests.py
Normal file
16
tests/regressiontests/model_regress/tests.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from models import Worker
|
||||
from django.test import TestCase
|
||||
|
||||
class RelatedModelOrderedLookupTest(TestCase):
|
||||
"""
|
||||
Regression test for #10153: foreign key __gte and __lte lookups.
|
||||
"""
|
||||
|
||||
# The bug is that the following queries would raise:
|
||||
# "TypeError: Related Field has invalid lookup: gte"
|
||||
|
||||
def test_related_gte_lookup(self):
|
||||
Worker.objects.filter(department__gte=0)
|
||||
|
||||
def test_related_lte_lookup(self):
|
||||
Worker.objects.filter(department__lte=0)
|
Loading…
Add table
Add a link
Reference in a new issue