Replies: 1 comment
-
Hi @halbow , how are you? I liked the idea. I think It may be implemented the same way we implemented the An API like: OrderStatusEnum = OrderStateMachine.states.as_enum() About the implementation, for compatibility with the class States:
...
def as_enum(self):
return Enum(f"{self.statemachine_name}Enum", {state.id: state.value for state in self}) Note that What do you think? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋
I hope you're doing well and thanks for this lib !
I've seen in the doc that it's possible to crate a
StateMachine
object from an enum but I would like to see if it would be possible to create anEnum
from theStateMachine
object ?My usecase for this is that I need an
Enum
for my Database schema but I prefer to keep one singleStateMachine
object instead of creating both two different object !For the moment I use something like this:
Let me know what you think, I can open a PR to implement the changes.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions