from copy import deepcopy
from django.contrib import admin
from seqr.models import Project, Family, Individual, Sample, LocusList, LocusListGene, LocusListInterval, VariantNote, \
    VariantTag, VariantTagType, VariantFunctionalData, SavedVariant, GeneNote, AnalysisGroup, ProjectCategory, \
    FamilyAnalysedBy

for model_class in [
    Project,
    Family,
    Individual,
    Sample,
    LocusList,
    LocusListGene,
    LocusListInterval,
    VariantNote,
    VariantTag,
    VariantTagType,
    VariantFunctionalData,
    SavedVariant,
    GeneNote,
    AnalysisGroup,
    ProjectCategory,
    FamilyAnalysedBy,
]:

    @admin.register(model_class)
    class SpecificModelAdmin(admin.ModelAdmin):
        search_fields = [field.name for field in model_class._meta.get_fields() if field.name in {
            'guid', 'name', 'display_name', 'family_id', 'individual_id', 'description'
        }]
        list_display = deepcopy(model_class._meta.json_fields if hasattr(model_class._meta, 'json_fields') else search_fields)
        if hasattr(model_class._meta, 'internal_json_fields'):
            list_display = model_class._meta.internal_json_fields + list_display
        if 'created_date' not in list_display:
            list_display.append('created_date')
        if 'last_modified_date' not in list_display:
            list_display.append('last_modified_date')
        save_on_top = True
        list_per_page = 2000

@@ -52,16 +52,134 @@
 t admin%0A
+from matchmaker.models import MatchmakerSubmission, MatchmakerIncomingQuery, MatchmakerResult, MatchmakerContactNotes%0A
 from seq
@@ -463,20 +463,16 @@
 ect,
-%0A   
  Family,
 %0A   
@@ -467,20 +467,16 @@
  Family,
-%0A   
  Individ
@@ -483,20 +483,16 @@
 ual,
-%0A   
  Sample,
 %0A   
@@ -487,20 +487,16 @@
  Sample,
-%0A   
  LocusLi
@@ -498,20 +498,16 @@
 cusList,
-%0A   
  LocusLi
@@ -513,20 +513,16 @@
 istGene,
-%0A   
  LocusLi
@@ -532,20 +532,16 @@
 nterval,
-%0A   
  Variant
@@ -545,20 +545,16 @@
 antNote,
-%0A   
  Variant
@@ -577,20 +577,16 @@
 TagType,
-%0A   
  Variant
@@ -600,20 +600,16 @@
 nalData,
-%0A   
  SavedVa
@@ -614,20 +614,16 @@
 Variant,
-%0A   
  GeneNot
@@ -624,20 +624,16 @@
 eneNote,
-%0A   
  Analysi
@@ -639,20 +639,16 @@
 isGroup,
-%0A   
  Project
@@ -656,20 +656,16 @@
 ategory,
-%0A   
  FamilyA
@@ -675,16 +675,108 @@
 ysedBy,%0A
+    MatchmakerSubmission, MatchmakerIncomingQuery, MatchmakerResult, MatchmakerContactNotes%0A
 %5D:%0A%0A    
@@ -1111,27 +1111,27 @@
 n_fields if 
-has
+get
 attr(model_c
@@ -1155,16 +1155,22 @@
 _fields'
+, None
 ) else s

add mme models to django admin