title: How to make a reservation system in django
body: <p>I am making a delivery date and time reservation system in django and there I need to implement a reservation system of time and date for the users.</p>
  <p><a href="https://i.stack.imgur.com/CSZCt.png" rel="nofollow noreferrer">see this UI image here for better understanding</a></p>
  <p>I have to make such a kind of thing that if a user reserves a specific time lets say 9 AM on a specific date and places an order, then that particular time related to that particular date that the user placed an order on will get disabled so that no other user can place an order on that same date and time.</p>
  <p>Now, the problem is I am not very sure how to design the database relationships for this feature.
  Initially I'm thinking of this model design bellow but I'm sure that it's not that much efficient.</p>
  <pre><code>class Date(models.Model):
      date = models.DateField()
      
  class Time(models.Model):
      time = models.TimeField(auto_now=False, auto_add_now=False)
      date = models.ForeignKey('Date', on_delete=models.CASCADE)
  </code></pre>
  <p>Let's assume that one of my users placed an order on 3rd of the month with a delivery time of 10 AM. So according to the system the time '10 AM' on 3rd of the month should get disabled for other users. But the time '10 AM' on other days of the month should still remain open for an order to be placed on.</p>
  <p>I don't understand how to do this whole thing with model relationships.</p>
  <p>Any help from you guys would be very beneficial for me. Please consider helping me with as much idea as you can.</p>
  <p>Thanks.</p>