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
{ref}`State` names are now by default derived from the class variable that they are assigned to. You can keep declaring explicit names, but we encourage you to only assign a name
24
+
when it is different than the one derived from its id.
25
+
26
+
```py
27
+
>>>from statemachine import StateMachine, State
28
+
29
+
>>>classSM(StateMachine):
30
+
... pending = State(initial=True)
31
+
... waiting_approval = State()
32
+
... approved = State(final=True)
33
+
...
34
+
... start = pending.to(waiting_approval)
35
+
... approve = waiting_approval.to(approved)
36
+
...
37
+
38
+
>>>SM.pending.name
39
+
'Pending'
40
+
41
+
>>>SM.waiting_approval.name
42
+
'Waiting approval'
43
+
44
+
>>>SM.approved.name
45
+
'Approved'
46
+
47
+
```
21
48
22
49
### Added support for internal transitions
23
50
@@ -28,7 +55,7 @@ are ever executed as a result of an internal transition.
0 commit comments