Commit graph

23 commits

Author SHA1 Message Date
David Smith
79ff8ea6be
Used isort to sort imports (#460) 2020-11-29 20:58:00 +00:00
Sergey Tikhonov
1386c379b7 FieldTracker should patch save_base instead of save (#404)
* 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
2019-12-15 22:43:58 +06:00
Sergey Tikhonov
d756a4a8ce patch Model.refresh_from_db in FieldTracker (#403)
* patch Model.refresh_from_db in FieldTracker

* add info about refresh_from_db patching to CHANGES.rst
2019-12-15 20:28:15 +06:00
Misha K
5aa40c66be Add django 3.0 to the test matrix and drop six (#395)
*  - 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.
2019-12-09 19:37:16 +06:00
Adam Dobrawy
ffa1a85dc7 Modernize Python syntax, add Python 3.8 (#398)
* Modernize Python syntax, add Python 3.8

* Update Python version & dist in TravisCI

* Add postgresql as addon

* Switch to psycopg2-binary

* Drop django.utils.six
2019-11-14 22:50:04 +06:00
Hasan Ramezani
aa94194dbc Drop Python 2 support. (#394) 2019-09-30 14:08:52 +06:00
Rémy HUBSCHER
e6c7b567d1
Remove unsupported django version hacks. 2019-08-21 11:02:23 +02:00
Eugene
7d9ebc1b49
Skip AbstractModelTrackerTests
https://github.com/jazzband/django-model-utils/pull/381
2019-08-20 19:00:25 +07:00
Eugene Kuznetsov
23148f481c fix test case 2019-08-05 18:45:48 +07:00
Eugene Kuznetsov
a3bada7e54 fix test case 2019-08-05 18:44:46 +07:00
Nick Sandford
d557c42533 Catch deferred attribute exception (#367) 2019-03-29 12:46:40 +06:00
Sergey Tikhonov
6b88c888d3 fix model.save patched in FieldTracker (#353)
* fix model.save patched in FieldTracker

* add test for save call with args

* update changes
2018-12-10 21:35:26 +06:00
tumb1er
ba83be0b43 fix #330 patch MyModel.save instead of MyModel().save 2018-11-20 18:32:09 +03:00
Lucas Wiman
600ddc8dc5 Fix F401: imported but unused. 2018-07-02 12:16:41 -07:00
Lucas Wiman
f845dcb24c Fix E231: missing whitespace after ",". 2018-07-02 11:49:16 -07:00
Lucas Wiman
654e13235e Fix E303 too many blank lines. 2018-07-02 11:47:19 -07:00
Lucas Wiman
7d6b45f0c1 Increase coverage: verify that accessing the descriptor from the class yields the descriptor object. 2018-06-28 17:04:57 -07:00
Lucas Wiman
cde1d706af Cover a branch in has_changed. 2018-06-28 14:08:03 -07:00
Lucas Wiman
5d410e9ccc Fix test failures from merge. 2018-06-28 11:29:44 -07:00
Lucas Wiman
98a1366608 Merge branch 'defer-has-changed' into django-1.11-compatibility 2018-06-21 12:52:33 -07:00
Lucas Wiman
80b099f129 Do not override custom descriptors when present.
This commit adds a collection of wrapper classes for tracking fields
while still using custom descriptors that may be present. This fixes
a bug where deferring a model field with a custom descriptor meant
that the descriptor was overridden in all subsequent queries.
2018-06-21 12:41:42 -07:00
Jack Cushman
d34043fd25 Avoid fetching deferred fields in has_changed 2018-02-10 10:53:36 -05:00
Bruno Alla
10ebc16271 Exclude tests from distribution
fixes #258
2017-02-15 23:00:10 +00:00
Renamed from model_utils/tests/test_fields/test_field_tracker.py (Browse further)