Untitled

mail@pastecode.io avatar
unknown
python
a year ago
1.8 kB
2
Indexable
Never
class SymptomAdmin(admin.ModelAdmin):
    list_display = ('id', 'idTypeSymp', 'idPacient', 'description', 'data')
    list_filter = ('idTypeSymp', 'idPacient', 'data')
    search_fields = ('description',)


class ExaminationAdmin(admin.ModelAdmin):
    list_display = ('id', 'idTypeExam', 'idPacient', 'description', 'data')
    list_filter = ('idTypeExam', 'idPacient', 'data')
    search_fields = ('description',)
    date_hierarchy = 'data'
    readonly_fields = ('upload',)
    
class DiagnosticsAdmin(admin.ModelAdmin):
    list_display = ('id', 'idDoenca', 'idPacient', 'idRelative', 'description')
    list_filter = ('idDoenca', 'idPacient', 'idRelative')
    search_fields = ('description',)
    
class TherapyAdmin(admin.ModelAdmin):
    list_display = ('id', 'idDrag', 'idPacient', 'description', 'data', 'dataInit', 'dataEnd')
    list_filter = ('idDrag', 'idPacient', 'data')
    search_fields = ('description',)
    date_hierarchy = 'data'
    fieldsets = (
        (None, {'fields': ('idDrag', 'idPacient', 'description')}),
        ('Dates', {'fields': ('data', 'dataInit', 'dataEnd'), 'classes': ('collapse',)})
    )
    
class AnaliseAdmin(admin.ModelAdmin):
    list_display = ('id', 'idAnalise', 'idPacient', 'value', 'data', 'description')
    list_filter = ('idAnalise', 'idPacient', 'data')
    search_fields = ('description',)
    date_hierarchy = 'data'
    readonly_fields = ('upload',)
    
class QuestionAdmin(admin.ModelAdmin):
    list_display = ('id', 'question', 'maxValue')
    search_fields = ('question',)
    
    
class ESSDAIAdmin(admin.ModelAdmin):
    list_display = ('id', 'idQuestion', 'idPacient', 'value', 'data')
    list_filter = ('idQuestion', 'idPacient', 'data')
    search_fields = ('idQuestion__question',)
    date_hierarchy = 'data'