mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
queryset-refactor: Made on of the tests use more portable SQL to help Oracle.
Patch from Ian Kelly. Fixed #7058. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7440 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
88488e5aa5
commit
0a66eabc8a
@ -473,7 +473,7 @@ FieldError: Infinite loop caused by ordering.
|
||||
>>> Ranking.objects.extra(tables=['django_site'], order_by=['-django_site.id', 'rank'])
|
||||
[<Ranking: 1: a3>, <Ranking: 2: a2>, <Ranking: 3: a1>]
|
||||
|
||||
>>> qs = Ranking.objects.extra(select={'good': 'rank > 2'})
|
||||
>>> qs = Ranking.objects.extra(select={'good': 'case when rank > 2 then 1 else 0 end'})
|
||||
>>> [o.good for o in qs.extra(order_by=('-good',))] == [True, False, False]
|
||||
True
|
||||
>>> qs.extra(order_by=('-good', 'id'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user