Django-fsm adds simple declarative state management for Django models. If you need parallel task execution, view, and background task code reuse over different flows - check my new project Django-view flow. Instead of adding a state field to a Django model and managing its values by hand, you use FSMField and mark model methods with the transition decorator. These methods could contain side effects of the state change. You may also take a look at the Django-fsm-admin project containing a mixin and template tags to integrate Django-fsm state transitions into the Django admin. FSM really helps to structure the code, especially when a new developer comes to the project. FSM is most effective when you use it for some sequential steps. Transition logging support could be achieved with help of django-fsm-log package.

Features

  • The field parameter accepts both a string attribute name or an actual field instance
  • Add FSMState field to your model
  • Use the transition decorator to annotate model methods
  • You can use * for source to allow switching to target from any state
  • You can use + for source to allow switching to target from any state exluding target state
  • target state parameter could point to a specific state or django_fsm.State implementation

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Django friendly finite state machine

Django friendly finite state machine Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Django friendly finite state machine!

Additional Project Details

Programming Language

Python

Related Categories

Python Software Development Software, Python Frameworks, Python Machine Learning Software

Registered

2022-08-30