Add typing for ConcurrencyManager and deprecate it.

Review Request #14044 — Created July 16, 2024 and submitted — Latest diff uploaded

Information

Djblets
release-6.x

Reviewers

This change adds generic parameters for ConcurrencyManager so it can be
used where we would expect a Manager.

This particular class also hasn't been useful since the very early days
of Django, since the base Manager.get_or_create implementation now does
exactly what this code does, preventing us from ever hitting the
exception handler. Because of that, I've removed the get_or_create
implementation entirely and marked the class as deprecated.

  • Ran unit tests.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Add typing for ConcurrencyManager.
This change adds generic parameters for `ConcurrencyManager` so it can be used where we would expect a Manager. It also fixes the fallback return for `get_or_create()` so we're always returning what a caller would expect from this method. Testing Done: Used with some other code.
c44583233a5b550b78e9305ad110ca3927e0cb65 David Trowbridge
djblets/db/managers.py
Loading...