From 42dc3b9ba247ea035e2d2855917592bdda5f5812 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 23 Apr 2008 09:53:22 +0000 Subject: queryset-refactor: Fixed the interaction between extra(select=...) and valuelist(). Fixed #7053. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7446 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/lookup/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py index a18be968aa..d134fb5265 100644 --- a/tests/modeltests/lookup/models.py +++ b/tests/modeltests/lookup/models.py @@ -180,6 +180,13 @@ True >>> Article.objects.valueslist('id', flat=True).order_by('id') [1, 2, 3, 4, 5, 6, 7] +>>> Article.objects.extra(select={'id_plus_one': 'id+1'}).order_by('id').valueslist('id') +[(1,), (2,), (3,), (4,), (5,), (6,), (7,)] +>>> Article.objects.extra(select={'id_plus_one': 'id+1'}).order_by('id').valueslist('id_plus_one', 'id') +[(2, 1), (3, 2), (4, 3), (5, 4), (6, 5), (7, 6), (8, 7)] +>>> Article.objects.extra(select={'id_plus_one': 'id+1'}).order_by('id').valueslist('id', 'id_plus_one') +[(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8)] + >>> Article.objects.valueslist('id', 'headline', flat=True) Traceback (most recent call last): ... -- cgit v1.3