-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.py
25 lines (20 loc) · 1.31 KB
/
admin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from django.contrib import admin
from app1.models import Patient, PatientData
# Models registered here for use in admin page
# fieldsets returns list of parameters up for editing
# listdisplay decides of order of display
# further additions include adding a search filter and parameter by which to reference object
class PatientAdmin(admin.ModelAdmin):
fieldsets = [
('General Information', {'fields': ['identifier', 'icr', 'cf', 'tdi', 'age', 'weight']}),
]
list_display = ('identifier', 'icr', 'cf', 'tdi', 'age', 'weight')
list_filter = ['identifier']
search_fields = ['identifier']
admin.site.register(Patient, PatientAdmin)
class PatientDataAdmin(admin.ModelAdmin):
fieldsets = [
('Medical Information', {'fields': ['patient', 'data_id', 'time', 'date', 'cgm_value', 'blood_glucose', 'insulin_infusion', 'sr', 'insulin_feed', 'controller_gain', 'mean_glucose', 'glucose_derivative', 'safety', 'basal_insulin', 'carbohydrates', 'calibration', 'sensor_saturation']}),
]
list_display = ('patient', 'data_id', 'time', 'date', 'cgm_value', 'blood_glucose', 'insulin_infusion', 'sr', 'insulin_feed', 'controller_gain', 'mean_glucose', 'glucose_derivative', 'safety', 'basal_insulin', 'carbohydrates', 'calibration', 'sensor_saturation')
admin.site.register(PatientData, PatientDataAdmin)