Commit graph

36 commits

Author SHA1 Message Date
Lucas Wiman
be52bc9290 Add failing test for deferred attributes. 2018-06-21 12:41:42 -07:00
Lucas Wiman
0fc0b44c95 Remove version checks for django<1.8.
Support for older versions of django was dropped in 3.0.0.
2018-06-21 12:41:42 -07:00
Alexey Evseev
9ee6065f81 Support Django 1.10 deferred FileField with FieldTracker 2016-09-08 18:00:48 +03:00
Jarek Glowacki
bbc076429a Nicer solution 2016-08-17 11:48:27 +10:00
Jarek Glowacki
922c49770e Django 1.10 support for FieldTracker 2016-08-15 12:24:07 +10:00
Roman
7ec978e1d8 1.10 fix 2016-05-27 20:32:16 +00:00
Mike Bryant
ff3f8e5546 Use all the fields to determine _id variants. Fixes #214
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`
2016-03-31 15:45:19 +01:00
bboogaard
041ef6b838 Keep track of deferred fields on model instance
Instead of on FieldInstanceTracker instance

Signed-off-by: bboogaard <b.boogaard@auto-interactive.nl>
2014-08-19 10:29:03 +02:00
Carl Meyer
a127e32217 Revert "Use a signal handler instead of patching save."
This reverts commit 3496fe4291.
2014-07-31 18:08:24 -06:00
Matthew Schinckel
3496fe4291 Use a signal handler instead of patching save.
References #83.

Instead of patching the save method of a tracked model class, we can use
a signal handler on post_save, which means we can still pickle our model
class.

Note we can't just listen for the signal from the class we have, but
instead listen for all post_save signals. This means we actually install
a new signal handler for each tracked model class, which fires on all
model save occurrences (and returns immediately if this handler doesn't care).

We probably could improve this to have a registry of tracked models, or
something, that allows us to just install one signal handler, and filter
according to membership.
2014-05-12 14:32:59 +09:30
Michael van Tellingen
2bcddd5be9 Add fix for Django 1.4 2014-03-01 14:24:25 +01:00
Michael van Tellingen
6ffae1ad8f Add support for deferred fields in the FieldTracker 2014-03-01 13:34:17 +01:00
Trey Hunner
e1faec7577 Merge pull request #73 from silonov/json_fields_support
Json fields support
2013-08-17 01:46:31 -07:00
Trey Hunner
2679f6114b Merge branch 'silonov-json_fields_support'
Conflicts:
	CHANGES.rst
	model_utils/tests/tests.py
2013-08-17 01:40:09 -07:00
Mikhail Silonov
ef510d53dd Removed reinvented wheel 2013-08-12 13:22:34 +04:00
Trey Hunner
15910e04e7 Merge branch 'field-tracker-inheritance'
Conflicts:
	CHANGES.rst
2013-08-11 18:49:20 -07:00
silonov
f20e723952 Added more general mutable fields support instead of json-specific 2013-08-11 19:32:45 +04:00
silonov
630741b423 Added JSONEncoder().encode(...) check for json-like fields 2013-08-10 01:59:06 +04:00
Mikhail Silonov
8c6f343111 Added JSON Fields support 2013-08-08 18:02:12 +04:00
Mikhail Silonov
b9f954074c Fixed a bug causing KeyError when saving with the parameter update_fields in which there are untracked fields. 2013-08-08 13:22:25 +04:00
Trey Hunner
98f078d718 Allow FieldTracker to work in child models
Fixes #57.
2013-07-29 12:54:49 -07:00
Trey Hunner
1474a48084 Improve FieldTracker docstrings 2013-05-28 10:14:49 -07:00
Trey Hunner
9dc3dacabf Fix FieldTracker's has_changed (fixes gh-51)
The FieldTracker has_changed method no longer returns True for any input
when the instance is unsaved and no longer raises a FieldError for
fields after the first save.  The original ModelTracker behavior is
maintained.
2013-05-24 22:22:20 -07:00
Trey Hunner
d28f3860cf Change FieldTracker `current` for unsaved model
Return None values instead of an empty dict
2013-05-23 16:38:12 -07:00
Trey Hunner
d190239c1f Improve docstrings and variables for FieldTracker 2013-05-23 16:25:10 -07:00
Trey Hunner
54c996f17f Don't compare FK instances in FieldTracker 2013-05-23 13:18:21 -07:00
Trey Hunner
6532784acd Create FieldTracker that mirrors ModelTracker 2013-05-23 12:50:34 -07:00
Trey Hunner
4f2673e6a4 Fix str/unicode problems in Python 3
Changes:
- Use unicode_literals from the future for Python 2.6.5+
- Use six's text_type for proper unicode use in Python 2/3
2013-04-12 14:16:42 -07:00
Trey Hunner
81c7e40e60 Fix iterator/list problems for Python 3 support 2013-04-12 14:16:42 -07:00
Trey Hunner
cddcbd4e42 ModelTracker: pass kwargs to parent save correctly
Fixes usage of update_fields in save()
2013-03-27 16:59:42 -07:00
Trey Hunner
d24dbc6c38 Fix ModelTracker for obj.save(update_fields=[...]) 2013-03-27 16:59:42 -07:00
Trey Hunner
45ac3bd03f Fix return value of ModelTracker.current pre-save 2013-02-18 17:32:30 -08:00
Trey Hunner
1ae2effc22 Merge ModelTracker and descriptor classes 2013-02-18 16:36:05 -08:00
Trey Hunner
a68649c9e7 Rename current_fields to current 2013-02-18 16:26:54 -08:00
Trey Hunner
f4512642cb Remove unnecessary use of setattr 2013-02-18 16:22:11 -08:00
Trey Hunner
676424e388 Move ModelTracker to tracker module 2013-02-18 16:21:14 -08:00