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
{{ message }}
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
[review] -> active <--> paused
| | |
| v |
\------> deleted <------/
review is the initial state.
Now I noticed, that both .save and __init__ of my model allow direct creation with states that are not review, not the default/initial state. There is custom code similar to this, to enforce that behavior:
def _deny_creation_with_non_initial_state(self):
if self.pk is None and self.status == ............:
raise TransitionNotAllowed()
def save(self, **kwargs):
self._deny_creation_with_non_initial_state()
super().save(**kwargs)
I have a feeling though that my approach is more complicated than necessary. Is there a way to add transitions from before existence to object creation a la source=None, target='review' or so? Any ideas?