On 31/03/2008, at 2:33 AM, mtrier wrote:
>
> Before opening a ticket I thought I would check what the expected
> behavior is for generative values(). This is the behavior I'm seeing
> on Queryset Refactor branch and to me it seems like it is not the
> correct behavior.
>
>>>> from original.foo.models import Category
>>>> Category.objects.all()
> [<Category: Algol>, <Category: Smalltalk>, <Category: PHP>, <Category:
> CSharp>]
>>>> Category.objects.values('name')
> [{'name': u'Algol'}, {'name': u'Smalltalk'}, {'name': u'PHP'},
> {'name': u'CSharp'}]
>>>> Category.objects.values('name', 'id')
> [{'name': u'Algol', 'id': 1}, {'name': u'Smalltalk', 'id': 2},
> {'name': u'PHP', 'id': 3}, {'name': u'CSharp', 'id': 4}]
>>>> Category.objects.values('name').values('id')
> [{'name': u'Algol'}, {'name': u'Smalltalk'}, {'name': u'PHP'},
> {'name': u'CSharp'}]
>
> It would seem to me that the last query should return the same thing
> as the prior one.
Agreed. This looks like a bug to me; at a guess, the problem will be
that when ValuesQuerySet is cloned, it doesn't copy the attribute list.
It may be worth checking if this is still a problem with queryset-
refactor; if it is stil a problem, it might be better to fix the
problem there, rather than trunk.
Yours,
Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---