Answers for "how to make booking website using django step by step"

0

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.
Posted by: Guest on December-30-2020

Code answers related to "how to make booking website using django step by step"

Python Answers by Framework

Browse Popular Code Answers by Language