pytransitions / transitions

A lightweight, object-oriented finite state machine implementation in Python with many extensions
MIT License
5.5k stars 525 forks source link

Comparison with django-fsm #435

Closed sam-ghosh closed 4 years ago

sam-ghosh commented 4 years ago

I wanted to know the pros and cons of django-fsm vs transitions , https://github.com/viewflow/django-fsm

Any info on the relative plus/minus of the two packages and which one is suitable where, if any such use cases favour one over another inside the business logic/transitions use cases will be appreciated

aleneum commented 4 years ago

Hello @somghosh,

since I don't know django-fsm, I cannot really compare it to transitions. django-fsm looks maintained and probably integrates easier with django as it is specifically designed for that. But I don't know if it has features transitions has not or vice versa.

I know that some people successfully use transitions with django but since it is not specifically designed for that purpose, some things need to be taken into account: transitions will decorate every model instance with convenience functions. This might cause a significant overhead. But there are solutions for that. See the FAQ notebook in examples and have a look at these issue: #434, #146. Someone wrote a django wrapper for transitions which you can find here. It has not been updated in a while so I cannot tell you how well it works with recent versions of transitions. Furthermore, you could search transitions issue tracker with django as a keyword and you find mutliple questions and stories about django and transitions.

aleneum commented 4 years ago

This became unfortunately stale. I will close it for now. Maybe a plattform like Reddit (r/python) or Hacker News will result in a more lively discussion. Feel free to open feature requests if you have gathered some feedback.