Open Becky139 opened 1 year ago
The answer to this conundrum lay within Django documentation. Querysets
It's abstracted so there is no need to open the database connection, perform actions, or close the connection.
Applied logic within the bookings/views.py function. Essentially, if a record exists for a specific date AND specific time, the program can branch to tell the user their attempt to create or edit an appointment to the same time cannot be done. The business can only perform one appointment at a time as there is 1 member of staff.
Note, as a small business only one client can be taken at a time.