I am using flask version 0.10.1 and python version 2.7.6
I have a web application that manages some orders. Let's say we have 3 orders:
order 1
order 2
order 3
There is a view
@main.route(/prder/<int:orderid>, methods=['GET'])
edit(orderid):
pass
The view is accesible only to registered users and I have a user object. Let's say we have to users user A and user B.
When A edits order 1 this order should not be editable by user B.
I need a mechanism that "locks" the order and the order is inaccessible for edits when user A is working on the order.
This "lock" need to be revoked when the user finishes editing*
- There is the scenario that user A closed the browser or stopped working on the order. Then I do not want the order to be "locked" forever.
Any ideas what is the best way to achieve the above functionality?