from django.db import models

class Winery(models.Model):
    title = models.CharField(max_length=150)

    def __str__(self):
        return self.title

class Wine(models.Model):
    title = models.CharField(max_length=150)
    vintage = models.IntegerField()
    winery = models.ForeignKey(Winery)

    def __str__(self):
        return '{winery} {wine}'.format(winery=self.winery, wine=self.title)

class Note(models.Model):
    wine = models.ForeignKey(Wine)

    def __str__(self):
        return 'Tasting note for: {wine}'.format(wine=self.wine)
from django.db import models

class Winery(models.Model):
    title = models.CharField(max_length=150)

    def __str__(self):
        return self.title

class Wine(models.Model):
    title = models.CharField(max_length=150)
    vintage = models.IntegerField()
    winery = models.ForeignKey(Winery)

    def __str__(self):
        return '{winery} {wine} {vintage}'.format(
            winery=self.winery, wine=self.title, vintage=self.vintage)

class Note(models.Model):
    wine = models.ForeignKey(Wine)

    def __str__(self):
        return 'Tasting note for: {wine}'.format(wine=self.wine)
Update to include vintage in string representation for Wine.
Update to include vintage in string representation for Wine.

  from django.db import models
  
  class Winery(models.Model):
      title = models.CharField(max_length=150)
  
      def __str__(self):
          return self.title
  
  class Wine(models.Model):
      title = models.CharField(max_length=150)
      vintage = models.IntegerField()
      winery = models.ForeignKey(Winery)
  
      def __str__(self):
-         return '{winery} {wine}'.format(winery=self.winery, wine=self.title)
+         return '{winery} {wine} {vintage}'.format(
+             winery=self.winery, wine=self.title, vintage=self.vintage)
  
  class Note(models.Model):
      wine = models.ForeignKey(Wine)
  
      def __str__(self):
          return 'Tasting note for: {wine}'.format(wine=self.wine)
Update to include vintage in string representation for Wine.
## Code Before:
from django.db import models

class Winery(models.Model):
    title = models.CharField(max_length=150)

    def __str__(self):
        return self.title

class Wine(models.Model):
    title = models.CharField(max_length=150)
    vintage = models.IntegerField()
    winery = models.ForeignKey(Winery)

    def __str__(self):
        return '{winery} {wine}'.format(winery=self.winery, wine=self.title)

class Note(models.Model):
    wine = models.ForeignKey(Wine)

    def __str__(self):
        return 'Tasting note for: {wine}'.format(wine=self.wine)
## Instruction:
Update to include vintage in string representation for Wine.
## Code After:
from django.db import models

class Winery(models.Model):
    title = models.CharField(max_length=150)

    def __str__(self):
        return self.title

class Wine(models.Model):
    title = models.CharField(max_length=150)
    vintage = models.IntegerField()
    winery = models.ForeignKey(Winery)

    def __str__(self):
        return '{winery} {wine} {vintage}'.format(
            winery=self.winery, wine=self.title, vintage=self.vintage)

class Note(models.Model):
    wine = models.ForeignKey(Wine)

    def __str__(self):
        return 'Tasting note for: {wine}'.format(wine=self.wine)