Skip to content
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

Transition with multiple from_state #55

Closed
gcollazo opened this issue Mar 27, 2014 · 2 comments · May be fixed by #75
Closed

Transition with multiple from_state #55

gcollazo opened this issue Mar 27, 2014 · 2 comments · May be fixed by #75

Comments

@gcollazo
Copy link
Contributor

From what I understand about this package it seems that if I have a state that can be transitioned to from multiple other states I would need to have an individual transition for each combinations of from_state and to_state.

For example I have a deleted stated that can be transition to from either new or draft. Is there a better way other than one transition per pair of states?

@ChristophMueller
Copy link

I have the same issue. Apparently, state groups cannot be used as "from_state". Transitions that are defined with the help of state groups do not show in the list of possible transitions.
Are we missing something?
I would have to implement redundant transitions for 5 different states leading to one final state.

I found the solution. Multiple from states have been added a while ago:
gvangool@5660240

Example:

class start(StateTransition):
  from_states = 'created', 'reset'
  to_state = 'started'
  description = 'Start the container'

gvangool added a commit to gvangool/django-states2 that referenced this issue Oct 6, 2015
- The model has a `purchase_state` (not `state`)
- Adds example of `from_states` (fixes vikingco#55)
gvangool added a commit to gvangool/django-states2 that referenced this issue May 30, 2016
- The model has a `purchase_state` (not `state`)
- Adds example of `from_states` (fixes vikingco#55)
@gcollazo
Copy link
Contributor Author

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants