Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. You are given the task of building the appointment system of a hospital. Patients, without registration, can book an appointment with a doctor
2. You are given the task of building the appointment system of a hospital. Patients, without registration, can book an appointment with a doctor by entering the preferred date, doctor's name, their name, and phone number. For this, you have created a Django app called apptservice. * Based on this scenario, create a model named Appointment. Write only the model class and their corresponding fields. 5 5 *) Create a form through which they can book an appointment by entering the data mentioned above. It should submit the data in url '/bookappt' via POST method. Write only the form code in your script. Create a view function that will either render the html file containing the form (assume that the name of the template is bookappt.html) or receive the submitted data. If data is being submitted, save the data in model, and send an Http Response giving the serial number of that patient. Serial number of the patient = (# of previous patient of that doctor on that day) + 1. [Hint: You can use count() method to get the length of a QuerySet. Use multiple filters.] Only write the view function on the script. You cannot use class-based view. 15
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started