aboutsummaryrefslogblamecommitdiffstats
path: root/ctrack/caf/admin.py
blob: f1aa860d0cdcd93ca69e9b53c5b02a4192500df2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

                                











                                              
 
 

                                                  
                                       

 




                                                   

 



                                                            

 
       

                                 



                                                                    


                                  
                                                            
                              
                                 
                            
                                                                
from django.contrib import admin

from .models import (
    CAF,
    FileStore,
    DocumentFile,
    Grading,
    ApplicableSystem,
    EssentialService,
)


class EssentialServiceAdmin(admin.ModelAdmin):
    model = EssentialService


class ApplicableSystemListAdmin(admin.ModelAdmin):
    model = ApplicableSystem
    list_display = ["name", "function"]


# FIXME
# class ApplicableSystemAdmin(admin.StackedInline):
#     model = ApplicableSystem
#     max_num = 3
#     extra = 1


# FIXME - NOT NEEDED
# def get_caf_name(obj):
#     ass = ApplicableSystem.objects.filter(caf=obj).first()
#     return f"{ass.organisation.name}_v{obj.version}"


# FIXME
class CAFAdmin(admin.ModelAdmin):
    model = CAF
    #   inlines = [ApplicableSystemAdmin]


#   list_display = ["quality_grading", "confidence_grading", "file"]


admin.site.register(CAF, CAFAdmin)
admin.site.register(EssentialService, EssentialServiceAdmin)
admin.site.register(FileStore)
admin.site.register(DocumentFile)
admin.site.register(Grading)
admin.site.register(ApplicableSystem, ApplicableSystemListAdmin)