Added string representation for Tour model
This commit is contained in:
@ -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}'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user