#9342: query optimization issue
------------------------------------------+---------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.0
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------------+---------------------------------
Comment (by [EMAIL PROTECTED]):
I run this hack against the Django unit tests
(...\tests\regressiontests\queries\models.py) and it fails against
ManyToMany type tests.
{{{
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.exclude(tags__name='t4').order_by('name').distinct()
Expected:
[<Item: one>, <Item: three>, <Item: two>]
Got:
[<Item: one>, <Item: two>]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.exclude(tags__name='t4').order_by('name').distinct().reverse()
Expected:
[<Item: two>, <Item: three>, <Item: one>]
Got:
[<Item: two>, <Item: one>]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.exclude(tags__name='t1').order_by('name')
Expected:
[<Item: four>, <Item: three>]
Got:
[<Item: four>]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.exclude(tags__name='t1').exclude(tags__name='t4')
Expected:
[<Item: three>]
Got:
[]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.exclude(tags__name='t1',
name='one').order_by('name').distinct()
Expected:
[<Item: four>, <Item: three>, <Item: two>]
Got:
[<Item: four>, <Item: two>]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.filter(name__in=['three',
'four']).exclude(tags__name='t1').order_by('name')
Expected:
[<Item: four>, <Item: three>]
Got:
[<Item: four>]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.exclude(~Q(tags__name='t1', name='one'))
Expected:
[<Item: one>]
Got:
[<Item: one>, <Item: one>]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.filter(~Q(tags__name='t1', name='one'), name='two')
Expected:
[<Item: two>]
Got:
[<Item: two>, <Item: two>]
----------------------------------------------------------------------
File "C:\Python25\Lib\site-
packages\tests\regressiontests\queries\models.py", line ?, in
regressiontests.queries.models.__test__.API_TESTS
Failed example:
Item.objects.exclude(~Q(tags__name='t1', name='one'), name='two')
Expected:
[<Item: four>, <Item: one>, <Item: three>]
Got:
[<Item: four>, <Item: one>, <Item: one>]
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/9342#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---