-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
In my app, I'm trying to show the full life cycles of objects using FSM.
While I love django-fsm-log for that purpose, the object creation itself is missing from these logs, as it's not a transition.
But after all, we could see this first step as a transition from the "None
state" to the "created
(default) state".
That's why I was wondering what is the best way, to create a StateLog instance when my object is created with the default state.
For example:
class SomeObject(models.Model):
state = FSMField(
choices=SomeObjectState.choices,
default="created",
protected=True,
)
some_obj = SomeObject.objects.create()
StateLog.objects.for_(some_obj).count() # I would love to have 1 item here!
Thanks.
Metadata
Metadata
Assignees
Labels
No labels