* 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>
There used to be a [bug in Django](https://code.djangoproject.com/ticket/30427)
that caused these tests to fail, according to the discussion of #370.
That bug was fixed in Django 4.0.
However, because the test model was using a `FieldTracker`
rather than a `ModelTracker`, all model-specific test cases
in `ModelTrackerTests` continued to fail.
Besides requiring less code, this also allows the django-stubs
mypy plugin to automatically generate a type-annotated version
of the manager.
Unfortunately, the plugin does not put a `ClassVar` annotation
on `objects`, which is why we need the suppression.
Avoid using `Self` as a type argument: for some reason this fails
when mypy has an empty cache, but passes when the cache has been
filled. Maybe it's a weird interaction between the mypy core and
the django-stubs plugin?
* Pass additional arguments to superclass `contribute_to_class()`
In Django 3.2 there is an additional argument `private_only` and more
could be added in future versions.
There were two classes named `StatusCustomManager`: the first is an
actual manager, the second a status model that uses a custom manager.
The latter is renamed to `CustomManagerStatusModel` in this commit.
* add test for reproducing FieldTracker update_fields issue
FieldTracker does not see update_fields changed in tracked model.save() method
* Patch Model.save_base instead of save
This change allows proper capturing update_fields kwarg if is is changed in overridden save() method.
* Add some details about FieldTracker implementation
* Mention FieldTracker behavior change
* - add django 3.0 to the test matrix
- drop six
* add entry in CHANGES
* remove context kwarg
* fix test with DeferredAttribute
* rename StringyDescriptor's name to attname
* Fix flake8
* Drop support for Django 1.11 because the API are not compatibles anymore with Django 3.0
* Try to fix tests.
* Define model for the field mock.
* Simplifies the code.
* Properly mock the field.
* Typo
* Use the new API field name.
* Call it attname
* Grab the field instance from the model.
* Use postgres in travis tests.
* Django 2.0.1 minimum is needed.
* Update Changelog to tell about breaking Django 1.11.
* Update changelog to tell about Django 3.0 support.
* @natim review.
* 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