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 2

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 and deprecate it.
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. Testing Done: Used with some other code.
eb69746a038570ca9f0ad9c1f0e95a87f9e9240f David Trowbridge
djblets/db/managers.py
Loading...