Re-implement modification notifications in simple_form
authorMagnus Hagander <magnus@hagander.net>
Thu, 24 Jan 2019 12:07:21 +0000 (13:07 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sat, 26 Jan 2019 15:19:26 +0000 (16:19 +0100)
commit5d0b64a5ab67cbec4cd702fd0c351448d114e8ca
treeba4d6ad709f7ec38c239fa4e54f28fdc1d14ffc9
parent2c84a8ec63d14738e5db65083940441a87c0e248
Re-implement modification notifications in simple_form

The way signals are sent for many2many apparently changed completely
between the python2 and python3 versions of the same Django version,
which broke the way we did this before. And it was always a bit of a
hack...

Instead, reimplement notifications in the simple_form handler. This now
also consolidates regular field notificationss and many2many
notifications in a much cleaner way.

This will, however, *only* have an effect on changes made through
simple_form. Luckily that's the most common way we handle forms, with
the exception being /admin/. So leave the old code in place to handle
the changes through /admin/, as well as the deletion of objects.

In the end the only thing lost is the ability to get m2m differences
when an admin makes changes, and that's the least important of all
notification. And as a bonus, the regular change notifications and in
particular "new item" notifications look a lot nicer.
pgweb/core/forms.py
pgweb/util/helpers.py
pgweb/util/signals.py