I have a requirement where users will be selecting a few rows from the front end table. (In my case it is React and Antd is the UI library).
When the user selects a row or rows from the frontend, those row information will be passed from frontend to the backend through ajax call, and those rows should be locked in the backend so that no other user can access the selected rows. If the rows are selected at the same time by some other user then a warning response should be sent to the user. For the backend, I'm using Django Rest Framework. I'm somewhat familiar with Django and Django Rest Framework on function-based view. For locking a row I know I've to use select_for_update method but I'm not sure how to implement it for multiple rows.
Can anyone please give me backend(i.e. Django Rest Framework) code example how to achieve this.