Does your model refer to any other fields for its default ordering?

http://docs.djangoproject.com/en/1.2/ref/models/querysets/#distinct


On Jul 21, 1:06 pm, rmschne <rmsc...@gmail.com> wrote:
> I'm trying to use the distinct() and it's giving me unexpected
> results.  Surely it's something simple, but I can't spot it.
>
> I've referred 
> tohttp://docs.djangoproject.com/en/dev/ref/models/querysets/#distinct
>
> In SQL, it would be:
> select distinct status from members;
>
> in Django I am using:
> statuscodes=Member.objects.values('status').distinct()
>
> With SQL I get the four distinct values of status from the database I
> expect.
>
> In Django, I get back a dictionary with every record.  I'm expecting
> only the four distinct records.
>
> Any thoughts on what i'm doing wrong?
>
> Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to