- 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.
* Fixed an infinite recursion bug when deleting a model, that has a reverse relationship to a tracked model with SET_NULL on_delete
---------
Co-authored-by: Napat Ch <napat@thevcgroup.com>
* ✅ Ensure TimeStampedModel modified equals created on initial creation.
Add logic to AutoLastModifiedField which checks to see if the associated created field of the correct cField class type is also present. If the instance has not yet been saved (missing a pk), then set the value to modified to be equal to created.
Fixes#247📚 Update changes and authors list related to changes.
* 🚑 Set TimeStampedModel modified to be equal to created during first save.
If instance does not yet have a pk, before defaulting the last modified to the current time, iterate over the the fields of the model, and instead use whatever value is found in the first occurance of the AutoCreatedField.
Fixes#247
* Move changelog up to unreleased section.
* Add the join manager + tests
* Documentation for join manager
* Use order_by for consistent tests
* Use postgres instead sqlite for tests for better reliability
* Fix coverage
* Drop django 1.8
Add pipe character at the beginning of each line so that all authors are
not concatenated together when ReStructuredText is parsed. Add Martey to
AUTHORS as well.
InheritanceQuerySet with `select_subclasses` applied as strings
raised AttributeError exception.
Adds a new test case `test_dj19_values_list_on_select_subclasses`
If a tracker is defined on an inherited model, where the parent has a ForeignKey,
the tracker will now correctly determine that the field_map takes `fk` -> `fk_id`
InheritanceQuerySetMixin._clone signature conflicts with django
ValuesQuerySet._clone code which calls super like this:
"c = super(ValuesQuerySet, self)._clone(klass, **kwargs)"