Add an option for turning distinct off when querying review requests.

Review Request #13370 — Created Oct. 23, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

This adds a distinct option for ReviewRequest.objects._query and all
wrapping functions, allowing callers to query review requests without
distinct. When distinct is turned on (which is still the default for
now), it can impact how queries are built, breaking .count() for
instance.

A future version of Review Board is likely to switch the default for
distinct to False, but this will require further testing.

The _query() function was given type hints in the process, to help
with the implementation of the function. Work has not been done on the
wrapping functions to provide type hints.

Unit tests pass.

Tested this with some in-progress code to simplify queries for the
datagrid pagination.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add an option for turning distinct off when querying review requests.
This adds a `distinct` option for `ReviewRequest.objects._query` and all wrapping functions, allowing callers to query review requests without distinct. When distinct is turned on (which is still the default for now), it can impact how queries are built, breaking `.count()` for instance. A future version of Review Board is likely to switch the default for `distinct` to `False`, but this will require further testing.
17c6766b40d83667fa05101698e8db75c85d4377 Christian Hammond
reviewboard/reviews/managers.py
Loading...