from django.contrib import admin
from lab_members.models import Position, Scientist, Institution, Degree, Field, Advisor, Education, Employment

class PositionAdmin(admin.ModelAdmin):
    search_fields = ['title']

admin.site.register(Position, PositionAdmin)


class EducationInline(admin.TabularInline):
    model = Education
    extra = 3


class EmploymentInline(admin.TabularInline):
    model = Employment
    extra = 3


class ScientistAdmin(admin.ModelAdmin):
    fieldsets = [
        ('Basic Info', {'fields': ['full_name', 'email', 'title', 'photo', 'current', 'alumni_redirect_url']}),
        ('Bio',        {'fields': ['personal_interests', 'research_interests']}),
        ('Advanced',   {'fields': ['slug'], 'classes': ['collapse']}),
    ]

    inlines = [EducationInline, EmploymentInline]

    list_display = ['full_name', 'title', 'email', 'current']
    list_filter = ['title', 'current']
    search_fields = ['full_name']

    prepopulated_fields = {"slug": ("full_name",)}

admin.site.register(Scientist, ScientistAdmin)


class InstitutionAdmin(admin.ModelAdmin):
    pass

admin.site.register(Institution, InstitutionAdmin)


class DegreeAdmin(admin.ModelAdmin):
    pass

admin.site.register(Degree, DegreeAdmin)


class FieldAdmin(admin.ModelAdmin):
    pass

admin.site.register(Field, FieldAdmin)


class AdvisorAdmin(admin.ModelAdmin):
    pass

admin.site.register(Advisor, AdvisorAdmin)

admin.site.site_header = 'Lab Member Administration'

@@ -477,21 +477,16 @@
 dset
-s = %5B%0A       
+_basic =
  ('B
@@ -498,16 +498,25 @@
 Info', %7B
+%0A        
 'fields'
@@ -522,58 +522,131 @@
 ': %5B
-'full_name', 'email', 'title', 'photo', 'current',
+%0A            'full_name',%0A            'email',%0A            'title',%0A            'photo',%0A            'current',%0A           
  'al
@@ -663,28 +663,54 @@
 ect_url'
-%5D%7D),
+,%0A        %5D%0A    %7D)%0A
 %0A    
-   
+fieldset_bio =
  ('Bio',
@@ -714,16 +714,18 @@
 o', 
+%7B%0A
        
-%7B
+ 
 'fie
@@ -731,16 +731,29 @@
 elds': %5B
+%0A            
 'persona
@@ -765,16 +765,28 @@
 erests',
+%0A           
  'resear
@@ -798,19 +798,16 @@
 terests'
-%5D%7D)
 ,%0A      
@@ -807,16 +807,51 @@
 %0A       
+ %5D,%0A    %7D)%0A%0A    fieldset_advanced =
  ('Advan
@@ -860,11 +860,18 @@
 d', 
+%7B%0A      
   
-%7B
 'fie
@@ -885,16 +885,24 @@
 'slug'%5D,
+%0A       
  'classe
@@ -917,18 +917,115 @@
 llapse'%5D
-%7D)
+,%0A    %7D)%0A%0A    fieldsets = %5B%0A        fieldset_basic,%0A        fieldset_bio,%0A        fieldset_advanced
 ,%0A    %5D%0A

Build fieldsets with modular approach