1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

queryset-refactor: Made all the changes needed to have count() work properly

with ValuesQuerySet. This is the general case of #2939.

At this point, all the existing tests now pass on the branch (except for
Oracle). It's a bit slower than before, though, and there are still a bunch of known bugs that aren't in the tests (or only exercised for some backends).


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2007-10-14 02:16:38 +00:00
parent cae24af822
commit 0ebb752e89
4 changed files with 128 additions and 55 deletions

View File

@@ -111,10 +111,17 @@ Bug #2080, #3592
>>> Author.objects.filter(Q(name='a3') | Q(item__name='one'))
[<Author: a1>, <Author: a3>]
Bug #2939
# FIXME: ValueQuerySets don't work yet.
# >>> Item.objects.values('creator').distinct().count()
# 2
Bug #1878, #2939
>>> Item.objects.values('creator').distinct().count()
3
# Create something with a duplicate 'name' so that we can test multi-column
# cases (which require some tricky SQL transformations under the covers).
>>> xx = Item(name='four', creator=a2)
>>> xx.save()
>>> Item.objects.exclude(name='two').values('creator', 'name').distinct().count()
4
>>> xx.delete()
Bug #2253
>>> q1 = Item.objects.order_by('name')