ccdb-api/ccdb/experiments/admin.py
2016-02-01 14:30:19 -07:00

44 lines
1.5 KiB
Python

from django.contrib import admin
from .models import Flaw, Experiment, ProtocolAttachment, TreatmentType
class FlawAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'sort_order')
list_display_links = ('name',)
search_fields = ('name', 'description')
list_per_page = 25
fields = ('name', 'description')
class ExperimentAdmin(admin.ModelAdmin):
list_display = ('name', 'code', 'description', 'flaw', 'sort_order')
list_display_links = ('name',)
search_fields = ('name', 'code', 'description', 'flaw', 'sort_order')
list_per_page = 25
fields = ('name', 'code', 'description', 'flaw', 'sort_order')
class ProtocolAttachmentAdmin(admin.ModelAdmin):
list_display = ('experiment', 'protocol')
list_display_links = ('protocol',)
search_fields = ('protocol',)
list_per_page = 25
fields = ('experiment', 'protocol')
class TreatmentTypeAdmin(admin.ModelAdmin):
list_display = ('experiment', 'name', 'code', 'treatment_type',
'placement', 'description', 'sort_order')
list_display_links = ('name',)
search_fields = ('experiment', 'name', 'code', 'treatment_type',
'placement', 'description')
list_per_page = 25
fields = ('experiment', 'name', 'code', 'treatment_type', 'placement',
'description', 'sort_order')
admin.site.register(Flaw, FlawAdmin)
admin.site.register(Experiment, ExperimentAdmin)
admin.site.register(ProtocolAttachment, ProtocolAttachmentAdmin)
admin.site.register(TreatmentType, TreatmentTypeAdmin)