Plugin: trigger action only once after multiple m2m change. #20062
kemeris2000
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on an SSH Keys plugin. It contains the model
netbox_ssh_keys.models.SSHList
, which has a many-to-many relationship with bothnetbox_ssh_keys.models.SSHKey
andvirtualization.models.VirtualMachine
.My problem is that I cannot find the appropriate place to execute code after a form is edited (or updated via the API) when multiple many-to-many relationships are modified. I have tried using signals, but in this case, the code executes twice. I need it to execute only once, after both many-to-many updates have finished.:
I also tried overriding
form_valid()
in thegeneric.ObjectEditView
class, but it does not seem to be executed.Beta Was this translation helpful? Give feedback.
All reactions