from django.contrib import admin

from .models import Wine, Grape, Winery

class GrapeInline(admin.TabularInline):
    model = Grape
    extra = 0


@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
    list_display = ["__str__", "year", "in_cellar",]
    fieldsets = (
        ('Bottle', {
            'fields': ('bottle_text', 'year', 'wine_type', 'winery',),
            }),
        ('Purchase', {
            'fields': ('date_purchased', 'price', 'store', 'importer'),
            }),
        ('Consumption', {
            'fields': ('date_consumed', 'liked_it', 'notes',),
            })
    )

    inlines = [
        GrapeInline,
    ]


admin.site.register(Winery)

from django.contrib import admin

from .models import Wine, Grape, Winery

class GrapeInline(admin.TabularInline):
    model = Grape
    extra = 0


@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
    list_display = ["__str__", "year", "wine_type", "in_cellar",]
    fieldsets = (
        ('Bottle', {
            'fields': ('bottle_text', 'year', 'wine_type', 'winery',),
            }),
        ('Purchase', {
            'fields': ('date_purchased', 'price', 'store', 'importer'),
            }),
        ('Consumption', {
            'fields': ('date_consumed', 'liked_it', 'notes',),
            })
    )

    inlines = [
        GrapeInline,
    ]


admin.site.register(Winery)

Add wine type to the list.
Add wine type to the list.

  from django.contrib import admin
  
  from .models import Wine, Grape, Winery
  
  class GrapeInline(admin.TabularInline):
      model = Grape
      extra = 0
  
  
  @admin.register(Wine)
  class WineAdmin(admin.ModelAdmin):
-     list_display = ["__str__", "year", "in_cellar",]
+     list_display = ["__str__", "year", "wine_type", "in_cellar",]
      fieldsets = (
          ('Bottle', {
              'fields': ('bottle_text', 'year', 'wine_type', 'winery',),
              }),
          ('Purchase', {
              'fields': ('date_purchased', 'price', 'store', 'importer'),
              }),
          ('Consumption', {
              'fields': ('date_consumed', 'liked_it', 'notes',),
              })
      )
  
      inlines = [
          GrapeInline,
      ]
  
  
  admin.site.register(Winery)
  
Add wine type to the list.
## Code Before:
from django.contrib import admin

from .models import Wine, Grape, Winery

class GrapeInline(admin.TabularInline):
    model = Grape
    extra = 0


@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
    list_display = ["__str__", "year", "in_cellar",]
    fieldsets = (
        ('Bottle', {
            'fields': ('bottle_text', 'year', 'wine_type', 'winery',),
            }),
        ('Purchase', {
            'fields': ('date_purchased', 'price', 'store', 'importer'),
            }),
        ('Consumption', {
            'fields': ('date_consumed', 'liked_it', 'notes',),
            })
    )

    inlines = [
        GrapeInline,
    ]


admin.site.register(Winery)

## Instruction:
Add wine type to the list.
## Code After:
from django.contrib import admin

from .models import Wine, Grape, Winery

class GrapeInline(admin.TabularInline):
    model = Grape
    extra = 0


@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
    list_display = ["__str__", "year", "wine_type", "in_cellar",]
    fieldsets = (
        ('Bottle', {
            'fields': ('bottle_text', 'year', 'wine_type', 'winery',),
            }),
        ('Purchase', {
            'fields': ('date_purchased', 'price', 'store', 'importer'),
            }),
        ('Consumption', {
            'fields': ('date_consumed', 'liked_it', 'notes',),
            })
    )

    inlines = [
        GrapeInline,
    ]


admin.site.register(Winery)
