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.
======================================================================
ERROR: test_migrate (model_utils.tests.tests.MigrationsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user/projects/django-model-utils/model_utils/tests/tests.py", line 42, in test_migrate
call_command('migrate', fake=True)
File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 167, in call_command
return klass.execute(*args, **defaults)
File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/base.py", line 337, in execute
output = self.handle(*args, **options)
File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 138, in handle
ProjectState.from_apps(apps),
File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 71, in from_apps
model_state = ModelState.from_model(model)
File "/home/user/projects/django-model-utils/.tox/py27-trunk/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 136, in from_model
e,
TypeError: Couldn't reconstruct field name_changed on tests.Monitored: MonitorField requires a "monitor" argument
Apologies to those whose names are mangled by this change.
It seems that distutils makes it impossible to handle non-ASCII content in a
setup.py long_description in a way that reliably works on Python 3 when the
system encoding is ASCII.