in qs-rf when many to many field referenced in order_by(), count() doesn't match length of queryset
|Reported by:||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If you include a many-to-many field which has multiple relationships for some objects you're querying in a call to order_by() then the .count() on the resulting queryset will not match the len() on the queryset if .count() is called before anything that loads the data (as if count() is called after the data is loaded then it returns the length of the data rather than doing the problematic query). I'm guessing Query.get_count() tries to run a simplified query.