Add typing for all model manager associations.

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

Information

Review Board
release-5.0.x

Reviewers

When associating a model manager, the type remains the default of a
Manager[_ModelT]. Unless given a more specific type, callers won't see
the methods on these managers.

This change goes through the codebase and adds explicit typing for each
model manager association. As a note for future associations, these must
be typed as ClassVars in order to safely override the original types.

Unit tests pass.

Verified that I could access methods for some of the ones relevant to my
query work without the type checker complaining.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add typing for all model manager associations.
When associating a model manager, the type remains the default of a `Manager[_ModelT]`. Unless given a more specific type, callers won't see the methods on these managers. This change goes through the codebase and adds explicit typing for each model manager association. As a note for future associations, these must be typed as `ClassVars` in order to safely override the original types.
e574768261e5d06fb4b681d14742eba8805bfa68 Christian Hammond
reviewboard/accounts/models.py
reviewboard/attachments/models.py
reviewboard/diffviewer/models/diffcommit.py
reviewboard/diffviewer/models/diffset.py
reviewboard/diffviewer/models/filediff.py
reviewboard/diffviewer/models/raw_file_diff_data.py
reviewboard/hostingsvcs/models.py
reviewboard/notifications/models.py
reviewboard/reviews/models/base_comment.py
reviewboard/reviews/models/default_reviewer.py
reviewboard/reviews/models/group.py
reviewboard/reviews/models/review.py
reviewboard/reviews/models/review_request.py
reviewboard/reviews/models/review_request_draft.py
reviewboard/reviews/models/status_update.py
reviewboard/scmtools/models.py
reviewboard/site/models.py
reviewboard/webapi/models.py
Loading...