how to make reserve app on django code example
Example: how to make booking website using django step by step
# models.py
Class Customer(models.Model):
email = models.EmailField()
# And whatever other custom fields here; maybe make a ForeignKey link to User? Whatever.
Class Table(models.Model):
seats = models.IntegerField()
min_people = models.IntegerField()
max_people = models.IntegerField()
Class Reservation(models.Model):
table = models.ForeignKey('Table', on_delete=Models.CASCADE)
party = models.ForeignKey('Customer', on_delete=Models.CASCADE)
spot = models.DateField()
# Make sure you don't use 'time' for this field, as that will cause a headache later on.