old_contents: from import_export import resources
  from import_export.admin import ImportExportActionModelAdmin
  
  from django.contrib import admin
  from .models import Speaker, Talk, Slot, Workshop
  
  
  class SlotAdmin(admin.ModelAdmin):
      list_display = ['date', 'get_description', 'room']
      list_filter = ['room']
      date_hierarchy = 'date'
  
      def get_queryset(self, request):
          return super().get_queryset(request).prefetch_related('content_object')
  
      def get_description(self, obj):
          return obj.content_object or obj.description
  
  
  class SpeakerResource(resources.ModelResource):
  
      class Meta:
          model = Speaker
          fields = export_order = (
              'full_name', 'keynote',
              'email', 'github', 'twitter',
          )
  
  
  class SpeakerAdmin(ImportExportActionModelAdmin):
      list_display = ['full_name', 'get_talks', 'get_workshops',
                      'keynote',  'is_public', 'display_position', ]
      list_filter = ['keynote', 'is_public']
      search_fields = ['full_name', 'email', 'github', 'twitter', ]
      resource_class = SpeakerResource
  
      def get_talks(self, obj):
          return ', '.join([t.title for t in obj.talks.all()])
      get_talks.short_description = 'talks'
  
      def get_workshops(self, obj):
          return ', '.join([w.title for w in obj.workshops.all()])
      get_workshops.short_description = 'workshops'
  
  
  class TalkAdmin(ImportExportActionModelAdmin):
      list_display = ['title', 'speakers', 'language', 'difficulty', ]
      search_fields = ['title', ]
  
      def speakers(self, obj):
          return ','.join(map(str, obj.talks.all()))
      speakers.short_description = 'speakers'
  
  
  class WorkshopAdmin(TalkAdmin):
      pass
  
  admin.site.register(Speaker, SpeakerAdmin)
  admin.site.register(Talk, TalkAdmin)
  admin.site.register(Workshop, WorkshopAdmin)
  admin.site.register(Slot, SlotAdmin)
  
new_contents: from import_export import resources
  from import_export.admin import ImportExportActionModelAdmin
  
  from django.contrib import admin
  from .models import Speaker, Talk, Slot, Workshop
  
  
  class SlotAdmin(admin.ModelAdmin):
      list_display = ['date', 'get_description', 'room']
      list_filter = ['room']
      date_hierarchy = 'date'
  
      def get_queryset(self, request):
          return super().get_queryset(request).prefetch_related('content_object')
  
      def get_description(self, obj):
          return obj.content_object or obj.description
  
  
  class SpeakerResource(resources.ModelResource):
  
      class Meta:
          model = Speaker
          fields = export_order = (
              'full_name', 'keynote',
              'email', 'github', 'twitter',
          )
  
  
  class SpeakerAdmin(ImportExportActionModelAdmin):
      list_display = ['full_name', 'get_talks', 'get_workshops',
                      'keynote',  'is_public', 'display_position', ]
      list_filter = ['keynote', 'is_public']
      search_fields = ['full_name', 'email', 'github', 'twitter', ]
      resource_class = SpeakerResource
  
      def get_talks(self, obj):
          return ', '.join([t.title for t in obj.talks.all()])
      get_talks.short_description = 'talks'
  
      def get_workshops(self, obj):
          return ', '.join([w.title for w in obj.workshops.all()])
      get_workshops.short_description = 'workshops'
  
  
  class TalkAdmin(ImportExportActionModelAdmin):
      list_display = ['title', 'speakers', 'language', 'difficulty', ]
      search_fields = ['title', ]
  
      def speakers(self, obj):
          return ','.join(map(str, obj.talks.all()))
      speakers.short_description = 'speakers'
  
  
  class WorkshopAdmin(TalkAdmin):
  
      def speakers(self, obj):
          return ','.join(map(str, obj.workshops.all()))
      speakers.short_description = 'speakers'
  
  admin.site.register(Speaker, SpeakerAdmin)
  admin.site.register(Talk, TalkAdmin)
  admin.site.register(Workshop, WorkshopAdmin)
  admin.site.register(Slot, SlotAdmin)
  
subject: fix workshop admin