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
Copy file name to clipboardExpand all lines: docs/hooks_and_conditions.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ You can hook into one or more lifecycle moments by adding the `@hook` decorator
17
17
was: Any='*',
18
18
was_not: Any=None,
19
19
changes_to: Any=None,
20
+
on_commit: Optional[bool] =None
20
21
):
21
22
```
22
23
## Lifecycle Moments
@@ -52,3 +53,4 @@ If you do not use any conditional parameters, the hook will fire every time the
52
53
| was | Any | Only fire the hooked method if the value of the `when` field was equal to this value when first initialized; defaults to `*`. |
53
54
| was_not | Any | Only fire the hooked method if the value of the `when` field was NOT equal to this value when first initialized. |
54
55
| changes_to | Any | Only fire the hooked method if the value of the `when` field was NOT equal to this value when first initialized but is currently equal to this value. |
56
+
| on_commit | bool | When `True` only fire the hooked method after the current database transaction has been commited or not at all. (Only applies to `AFTER_*` hooks) |
0 commit comments