2021-03-23 17:08:00 -04:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2021-03-23 17:11:11 -04:00
|
|
|
from .models import (CmsRedRiverVeteransScholarship,
|
|
|
|
CertificationDefinition, Certification,
|
|
|
|
InstructorOrVendor, SpecialProgram, Waiver,
|
|
|
|
Member)
|
2021-03-23 17:08:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
class CertificationDefinitionAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ['certification_name', 'department']
|
|
|
|
|
|
|
|
|
|
|
|
class CertificationAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ['name', 'certification__certification_name', 'certification__department']
|
|
|
|
|
|
|
|
|
|
|
|
class InstructorOrVendorAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ['name']
|
|
|
|
|
|
|
|
|
|
|
|
class SpecialProgramAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ['program_name']
|
|
|
|
|
|
|
|
|
|
|
|
class WaiverAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ['name']
|
|
|
|
|
|
|
|
|
2021-03-23 17:11:11 -04:00
|
|
|
class MemberAdmin(admin.ModelAdmin):
|
|
|
|
readonly_fields = [field.name for field in Member._meta.get_fields() if field.concrete]
|
|
|
|
|
|
|
|
def has_add_permission(self, request, obj=None):
|
|
|
|
return False
|
|
|
|
|
|
|
|
def has_delete_permission(self, request, obj=None):
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
2021-03-23 17:08:00 -04:00
|
|
|
admin.site.register(CmsRedRiverVeteransScholarship)
|
|
|
|
admin.site.register(CertificationDefinition, CertificationDefinitionAdmin)
|
|
|
|
admin.site.register(Certification, CertificationAdmin)
|
|
|
|
admin.site.register(InstructorOrVendor, InstructorOrVendorAdmin)
|
|
|
|
admin.site.register(SpecialProgram, SpecialProgramAdmin)
|
|
|
|
admin.site.register(Waiver, WaiverAdmin)
|
2021-03-23 17:11:11 -04:00
|
|
|
admin.site.register(Member, MemberAdmin)
|