I'm guessing your Members model is referencing the User model? Check
the ordering as related models will influence your distinct. If your
Members model has its own ordering that will also come into effect
even though your picking your value out explicitly:

"If you order by fields from a related model, those fields will be
added to the selected columns and they may make otherwise duplicate
rows appear to be distinct....The moral here is that if you are using
distinct() be careful about ordering by related models. Similarly,
when using distinct() and values() together, be careful when ordering
by fields not in the values() call."

Member.objects.values('status').order_by('status').distinct()

Should give the correct count.

-- 
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