Tutorial 5 Add Records via ipython
This commit is contained in:
parent
191b9d605f
commit
df324bfa63
1 changed files with 4 additions and 0 deletions
|
|
@ -7,3 +7,7 @@ class Tour(models.Model):
|
||||||
destination_country = models.CharField(max_length=64)
|
destination_country = models.CharField(max_length=64)
|
||||||
nights = models.IntegerField()
|
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.nights} nights cost ${self.price}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue