Hey Jozef,

Thanks for the reply —very interesting.

I haven’t dug too deep into django-fsm, mostly browsed the code for inspiration.

Using the “lightweight” optimistic approach (as you call it) — does it mean I cannot reliably implement an action that dont trigger a state transition?

I’ve had several cases where more than one action were required before a transition could me made.

For example, applying for a student load requires updating personal information and uploading a student certificate. These are two seperate actions and only when both are completed the user can submit the request for approval:

  • create() -> state PRISTINE
  • update_personal_information()
  • upload_student_certificate()
  • submit_for_approval() -> state PENDING_APPROVAL

Using a lightweight optimisitc locking, can I prevent concurrancy issues in calls to update_personal_details and upload_student_certificate (given that both are executed at state PRISITINE)?

Full Stack Developer, Team Leader, Independent. More from me at https://hakibenita.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store