13 lines
468 B
Python
13 lines
468 B
Python
from django.db import models
|
|
|
|
|
|
# Create your models here.
|
|
class Tour(models.Model):
|
|
origin_country = models.CharField(max_length=64)
|
|
destination_country = models.CharField(max_length=64)
|
|
nights = models.IntegerField()
|
|
price = models.IntegerField()
|
|
|
|
# This is a string representation of the tour
|
|
def __str__(self):
|
|
return f"ID:{self.id}: From {self.origin_country} To {self.destination_country}, {self.nights} nights cost ${self.price}"
|