Added string representation for Tour model

This commit is contained in:
2025-05-29 14:41:04 -04:00
parent 034a722ca8
commit 8270549d68

View File

@ -8,4 +8,9 @@ class Tour(models.Model):
number_of_nights = models.IntegerField() number_of_nights = models.IntegerField()
price = 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.number_of_nights} nights. Cost: ${self.price}'