old_contents: from django import forms
  from django.contrib import admin
  from django.forms.models import modelformset_factory
  from django.forms.models import inlineformset_factory
  from django.contrib.contenttypes import generic
  
  from knesset.mks.models import *
  from knesset.links.models import Link
  from knesset.video.models import Video
  
  
  class MembershipInline(admin.TabularInline):
      model = Membership
      extra = 1
      
  class MemberLinksInline(generic.GenericTabularInline):
      model = Link
      ct_fk_field = 'object_pk'
      extra = 1
  
  class MemberAltnameInline(admin.TabularInline):
      model = MemberAltname
      extra = 1
  
  class MemberRelatedVideosInline(generic.GenericTabularInline):
      model = Video
      ct_fk_field = 'object_pk'
      can_delete = False
      fields = ['title','description','embed_link','group','sticky','hide']
      ordering = ['group','-sticky','-published']
      readonly_fields = ['title','description','embed_link','group']
      extra = 0
      def queryset(self, request):
          qs = super(MemberRelatedVideosInline, self).queryset(request)
          qs = qs.filter(hide=False)
          return qs
  
  class PartyAdmin(admin.ModelAdmin):
      ordering = ('name',)
  #    fields = ('name','start_date','end_date', 'is_coalition','number_of_members')
      list_display = ('name','start_date', 'end_date','is_coalition', 'number_of_members', 'number_of_seats')
      inlines = (MembershipInline,)
  
  admin.site.register(Party, PartyAdmin)
  
  class MemberAdmin(admin.ModelAdmin):
      ordering = ('name',)
  #    fields = ('name','start_date','end_date')
      list_display = ('name','PartiesString')
      inlines = (MembershipInline, MemberLinksInline, MemberAltnameInline, MemberRelatedVideosInline)
  
      # A template for a very customized change view:
      change_form_template = 'admin/simple/change_form_with_extra.html'
  
      
      def change_view(self, request, object_id, extra_context=None):
          m = Member.objects.get(id=object_id)
          my_context = {
              'extra': {'hi_corr':m.CorrelationListToString(m.HighestCorrelations()),
                        'low_corr':m.CorrelationListToString(m.LowestCorrelations()),
                        }
          }
          return super(MemberAdmin, self).change_view(request, object_id,
              extra_context=my_context)
  admin.site.register(Member, MemberAdmin)
  
  class CorrelationAdmin(admin.ModelAdmin):
      ordering = ('-normalized_score',)
  admin.site.register(Correlation, CorrelationAdmin)
  
  class MembershipAdmin(admin.ModelAdmin):
      ordering = ('member__name',)
  admin.site.register(Membership, MembershipAdmin)
  
new_contents: from django import forms
  from django.contrib import admin
  from django.forms.models import modelformset_factory
  from django.forms.models import inlineformset_factory
  from django.contrib.contenttypes import generic
  from django.db.models import Q
  
  from knesset.mks.models import *
  from knesset.links.models import Link
  from knesset.video.models import Video
  
  
  class MembershipInline(admin.TabularInline):
      model = Membership
      extra = 1
      
  class MemberLinksInline(generic.GenericTabularInline):
      model = Link
      ct_fk_field = 'object_pk'
      extra = 1
  
  class MemberAltnameInline(admin.TabularInline):
      model = MemberAltname
      extra = 1
  
  class MemberRelatedVideosInline(generic.GenericTabularInline):
      model = Video
      ct_fk_field = 'object_pk'
      can_delete = False
      fields = ['title','description','embed_link','group','sticky','hide']
      ordering = ['group','-sticky','-published']
      readonly_fields = ['title','description','embed_link','group']
      extra = 0
      def queryset(self, request):
          qs = super(MemberRelatedVideosInline, self).queryset(request)
          qs = qs.filter(Q(hide=False) | Q(hide=None))
          return qs
  
  class PartyAdmin(admin.ModelAdmin):
      ordering = ('name',)
  #    fields = ('name','start_date','end_date', 'is_coalition','number_of_members')
      list_display = ('name','start_date', 'end_date','is_coalition', 'number_of_members', 'number_of_seats')
      inlines = (MembershipInline,)
  
  admin.site.register(Party, PartyAdmin)
  
  class MemberAdmin(admin.ModelAdmin):
      ordering = ('name',)
  #    fields = ('name','start_date','end_date')
      list_display = ('name','PartiesString')
      inlines = (MembershipInline, MemberLinksInline, MemberAltnameInline, MemberRelatedVideosInline)
  
      # A template for a very customized change view:
      change_form_template = 'admin/simple/change_form_with_extra.html'
  
      
      def change_view(self, request, object_id, extra_context=None):
          m = Member.objects.get(id=object_id)
          my_context = {
              'extra': {'hi_corr':m.CorrelationListToString(m.HighestCorrelations()),
                        'low_corr':m.CorrelationListToString(m.LowestCorrelations()),
                        }
          }
          return super(MemberAdmin, self).change_view(request, object_id,
              extra_context=my_context)
  admin.site.register(Member, MemberAdmin)
  
  class CorrelationAdmin(admin.ModelAdmin):
      ordering = ('-normalized_score',)
  admin.site.register(Correlation, CorrelationAdmin)
  
  class MembershipAdmin(admin.ModelAdmin):
      ordering = ('member__name',)
  admin.site.register(Membership, MembershipAdmin)
  
subject: fix big with hide=null