You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a user adds a hook to their StructuredRel subclass model with the intention of populating some fields before the node gets saved, it won't work. The hook will fire and it will run the code that updates the fields, however after the node is saved the database will contain the pre-hook stage values. The reason is that the node instance that is passed to the hook is discarded after the hook has executed, I traced this problem to this code chunk. The params dict would hold the pre-hook stage values, and there is no way to influence this process for inside the hook.
I think being able to modify the actual object within a hook is important. I used a pre_save hook so I could implement the updated_at property that is updated each time an object is saved.
The text was updated successfully, but these errors were encountered:
If a user adds a hook to their
StructuredRel
subclass model with the intention of populating some fields before the node gets saved, it won't work. The hook will fire and it will run the code that updates the fields, however after the node is saved the database will contain the pre-hook stage values. The reason is that the node instance that is passed to the hook is discarded after the hook has executed, I traced this problem to this code chunk. Theparams
dict would hold the pre-hook stage values, and there is no way to influence this process for inside the hook.I think being able to modify the actual object within a hook is important. I used a
pre_save
hook so I could implement theupdated_at
property that is updated each time an object is saved.The text was updated successfully, but these errors were encountered: