Django multiple parents and every parent may have the same children, but changing one children should be changed for this parent not the others?

I have a system for ambulance service built with Django, React for the API and dashboard and Android for the mobile app, where crew belong to an ambulance and ambulance has calls and every call has forms and every form has questions

Now when the crew login to the mobile app he will see his ambulance details and its calls and inside each call, he will see the forms

Now crew need to do two things, submit forms and submit call

In case submitting a form, it should be shown on the admin dashboard a list of submitted forms

and in case to submit a call, the crew must submit first all required forms inside that call, and submitted calls should be shown on the admin dashboard

Also, I need to make checkbox done on the mobile app to the submitted call or form

To solve this, I added a boolean field for the call model and form model to check if a call or form is submitted

Now the client didn’t want that, because he could assign the same form or call for another ambulance that has a different crew, so in my case, if another crew logged to the app he will see that call or form is submitted because of this bool condition I put before

I thought in keeping the original calls or forms in a table and copying the submitted form or call to another table but seems not efficient

Could someone give some hint for solving that?

here is my models

Leave a Comment