-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Available actions #19
Comments
Hello Aly, I would also like to take this on. I am thinking I could add an attribute to the StateMachine class for transitions which would be a dictionary of transitions, and then add some methods to return available transitions based on sources and targets. It looks like they do something similar with FSMMeta in django-fsm in this file. |
That makes sense. I think we do something similar for functions where we store meta information in the |
Please take this one; would love the help! |
Hello Aly, I might need some feedback on this. What is the best place to reach out to you? |
Can you create a pull request with your changes? Would make it easier to discuss |
Ok! I opened one! Let me know if I am way off, or if this was not what you were looking for. #22 |
I think the way to do this is to change the class TransitionDecorator:
transition_mapping = {}
def __init__(self):
pass
def __call__(self, *args, *kwargs):
# return a decorator
# when creating decorator, add elements to use self.__class__.transition_mapping Class will allow us to have state saved. Need to figure out how to access this mapping from the state machine sub-class |
Given the current state, what actions are available?
The text was updated successfully, but these errors were encountered: