from django.db import models
from django.contrib.auth.models import User
from tour.models import Tour


class Booking(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
    tour = models.ForeignKey(Tour, on_delete=models.CASCADE)
    number_of_people = models.IntegerField()
    start_date = models.DateField(default=None)
    end_date = models.DateField(default=None)
    price = models.DecimalField(max_digits=8, decimal_places=2, null=True)

    def __str__(self):
        return self.tour.name + ' - ' + str(self.start_date)

256c392093ecb66729e860e2322cbfce6792c217
<mask token>


class Booking(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

<mask token>


class Booking(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __str__(self):
        return self.tour.name + ' - ' + str(self.start_date)

<mask token>


class Booking(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
    tour = models.ForeignKey(Tour, on_delete=models.CASCADE)
    number_of_people = models.IntegerField()
    start_date = models.DateField(default=None)
    end_date = models.DateField(default=None)
    price = models.DecimalField(max_digits=8, decimal_places=2, null=True)

    def __str__(self):
        return self.tour.name + ' - ' + str(self.start_date)

from django.db import models
from django.contrib.auth.models import User
from tour.models import Tour


class Booking(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
    tour = models.ForeignKey(Tour, on_delete=models.CASCADE)
    number_of_people = models.IntegerField()
    start_date = models.DateField(default=None)
    end_date = models.DateField(default=None)
    price = models.DecimalField(max_digits=8, decimal_places=2, null=True)

    def __str__(self):
        return self.tour.name + ' - ' + str(self.start_date)
