Actually, I tried to do it that way but I never got it working. Not sure 
what is different now but this is what I have working for me now:  

qs = qs.values('make').annotate(model_count=Count('model', distinct=True)).
annotate(
    more_than_one_model=Case(
        When(model_count__gt=1, then=Value('yes')),
        default=Value('no'),
        output_field=CharField()
    )
)  

Thanks for leading me back on the right track.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9c7276b8-446e-4557-bfef-0f70fd9e2c9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to