django-model-utils/model_utils
Benedikt Willi f09ea0e472 Fix compatibility issues with django-modeltranslation by modifying manager mixins
- Added a new class `_GenericMixin` to serve as a runtime placeholder for `Generic[ModelT]`. This change prevents `TypeError` during `__class__` assignments, which was an issue when mixins inherited from `Generic[T]` at runtime.
- All manager mixins have been updated to inherit from `_GenericMixin` instead of `Generic[ModelT]`. This ensures compatibility with `django-modeltranslation`.
- Introduced regressions tests to confirm that the manager instances support `__class__` reassignment without issues. Tests were added for `SoftDeletableManager`, `InheritanceManager`, `QueryManager`, and `JoinManager`.

Closes GH-#636.
2025-12-15 11:38:33 +01:00
..
locale Translation files 2024-04-01 15:09:46 +02:00
__init__.py Suppress error about __version__ being None when not installed 2024-04-05 17:15:16 +02:00
choices.py Make type aliases compatible with old Python versions 2024-06-13 12:02:05 +02:00
fields.py Provide type arguments to field base classes 2024-06-13 12:02:05 +02:00
managers.py Fix compatibility issues with django-modeltranslation by modifying manager mixins 2025-12-15 11:38:33 +01:00
models.py Annotate the models module 2024-06-13 12:02:05 +02:00
py.typed Add py.typed 2023-01-23 22:03:56 +00:00
tracker.py Fixed an infinite recursion bug when deleting models related to a tracked model with a ForeignKey (#620) 2025-04-03 19:58:57 +02:00