[Django]-Can you code a django-fsm transition that targets an arbitrary state?

2👍

Although as author of django-fsm I highly don’t recommend use your approach, I think finally it could leads you to if-elif trash inside set_state function, I could suggest, not to implement it as model method.

Instead just make a regular function, and update db state directly.

def set_state(tube, new_state):
SampleTube.objects.filter(pk=tube.pk).update(state=new_state);

Leave a comment