It works by recording values in the `post_init` signal, then checking
their values in the `post_save` signal, and then triggering its own
`post_save_changed` signal if the values are different.
The problem is that currently there's no way this can detect someone
calling `Model.refresh_from_db()`. If I could detect that, I would
overwrite the stored values from `post_init` with some new values.
Otherwise my app may detect 'changes' which have actually already been
applied to the database.
A `post_refresh_from_db` signal seems conspicuously absent. Or perhaps
`post_init` should be called again when `refresh_from_db` is called? That
would also solve my problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/30662>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Craig de Stigter):
Ticket on my app for this: https://github.com/craigds/django-
fieldsignals/issues/17
--
Ticket URL: <https://code.djangoproject.com/ticket/30662#comment:1>
* status: new => closed
* version: 2.2 => master
* resolution: => wontfix
Comment:
Thanks for this ticket, however I think it's quite niche and even with
this signal you will have few missing scenarios e.g. using
`QuerySet.update()` (see #21461).
Needs discussion on the django-developers mailing list in order to be
accepted.
--
Ticket URL: <https://code.djangoproject.com/ticket/30662#comment:2>