from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from cpm_data.models import JuryMember


class MyPageModelAdmin(ModelAdmin):
    model = JuryMember
    menu_label = 'Jury'
    menu_order = 200  # will put in 3rd place (000 being 1st, 100 2nd)
    list_display = ('name', 'country')
    search_fields = ('name_en', 'name_be', 'name_ru')


modeladmin_register(MyPageModelAdmin)

from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from cpm_data.models import JuryMember, Partner, Season


class SeasonModelAdmin(ModelAdmin):
    model = Season
    menu_label = 'Seasons'
    menu_icon = 'date'
    menu_order = 200
    list_display = ('name_en', 'name_be', 'name_ru')
    search_fields = ('name_en', 'name_be', 'name_ru')


class JuryMemberModelAdmin(ModelAdmin):
    model = JuryMember
    menu_label = 'Jury'
    menu_icon = 'group'
    menu_order = 210
    list_display = ('name_en', 'name_be', 'name_ru', 'country')
    search_fields = ('name_en', 'name_be', 'name_ru')


class PartnerModelAdmin(ModelAdmin):
    model = Partner
    menu_label = 'Partners'
    menu_icon = 'grip'
    menu_order = 220
    list_display = ('name_en', 'name_be', 'name_ru', 'image')
    search_fields = ('name_en', 'name_be', 'name_ru')


modeladmin_register(SeasonModelAdmin)
modeladmin_register(JuryMemberModelAdmin)
modeladmin_register(PartnerModelAdmin)

Add modeladmin classes for Season, JuryMember, Partner models
Add modeladmin classes for Season, JuryMember, Partner models

  from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
- from cpm_data.models import JuryMember
+ from cpm_data.models import JuryMember, Partner, Season
  
  
- class MyPageModelAdmin(ModelAdmin):
+ class SeasonModelAdmin(ModelAdmin):
-     model = JuryMember
+     model = Season
-     menu_label = 'Jury'
+     menu_label = 'Seasons'
-     menu_order = 200  # will put in 3rd place (000 being 1st, 100 2nd)
-     list_display = ('name', 'country')
+     menu_icon = 'date'
+     menu_order = 200
+     list_display = ('name_en', 'name_be', 'name_ru')
      search_fields = ('name_en', 'name_be', 'name_ru')
  
  
- modeladmin_register(MyPageModelAdmin)
+ class JuryMemberModelAdmin(ModelAdmin):
+     model = JuryMember
+     menu_label = 'Jury'
+     menu_icon = 'group'
+     menu_order = 210
+     list_display = ('name_en', 'name_be', 'name_ru', 'country')
+     search_fields = ('name_en', 'name_be', 'name_ru')
  
+ 
+ class PartnerModelAdmin(ModelAdmin):
+     model = Partner
+     menu_label = 'Partners'
+     menu_icon = 'grip'
+     menu_order = 220
+     list_display = ('name_en', 'name_be', 'name_ru', 'image')
+     search_fields = ('name_en', 'name_be', 'name_ru')
+ 
+ 
+ modeladmin_register(SeasonModelAdmin)
+ modeladmin_register(JuryMemberModelAdmin)
+ modeladmin_register(PartnerModelAdmin)
+ 
Add modeladmin classes for Season, JuryMember, Partner models
## Code Before:
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from cpm_data.models import JuryMember


class MyPageModelAdmin(ModelAdmin):
    model = JuryMember
    menu_label = 'Jury'
    menu_order = 200  # will put in 3rd place (000 being 1st, 100 2nd)
    list_display = ('name', 'country')
    search_fields = ('name_en', 'name_be', 'name_ru')


modeladmin_register(MyPageModelAdmin)

## Instruction:
Add modeladmin classes for Season, JuryMember, Partner models
## Code After:
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from cpm_data.models import JuryMember, Partner, Season


class SeasonModelAdmin(ModelAdmin):
    model = Season
    menu_label = 'Seasons'
    menu_icon = 'date'
    menu_order = 200
    list_display = ('name_en', 'name_be', 'name_ru')
    search_fields = ('name_en', 'name_be', 'name_ru')


class JuryMemberModelAdmin(ModelAdmin):
    model = JuryMember
    menu_label = 'Jury'
    menu_icon = 'group'
    menu_order = 210
    list_display = ('name_en', 'name_be', 'name_ru', 'country')
    search_fields = ('name_en', 'name_be', 'name_ru')


class PartnerModelAdmin(ModelAdmin):
    model = Partner
    menu_label = 'Partners'
    menu_icon = 'grip'
    menu_order = 220
    list_display = ('name_en', 'name_be', 'name_ru', 'image')
    search_fields = ('name_en', 'name_be', 'name_ru')


modeladmin_register(SeasonModelAdmin)
modeladmin_register(JuryMemberModelAdmin)
modeladmin_register(PartnerModelAdmin)
