dabapps / django-rest-framework-serialization-spec

DEPRECATED, see https://github.com/dabapps/django-readers instead
MIT License
11 stars 0 forks source link

Should CountOf use Count(..., distinct=True) by default? Or allow it to be specified? #27

Open pmg103 opened 4 years ago

pmg103 commented 4 years ago

Its not clear to me but if you don't specify distinct=True to django.db.models.Count() sometimes you get dupes -- ie the wrong count.

I feel like this is non-obvious and the CountOf() plugin should just always use distinct=True. When would you ever want dupes included in your count? 🤔