Use autocomplete for member field in Certification admin

This commit is contained in:
Adam Goldsmith 2022-02-03 16:36:37 -05:00
parent a892f11c0f
commit 030cbe8a92
2 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ from .models import Member
@admin.register(Member)
class MemberAdmin(admin.ModelAdmin):
readonly_fields = [field.name for field in Member._meta.get_fields() if field.concrete]
search_fields = ['account_name']
def has_add_permission(self, request, obj=None):
return False

View File

@ -13,6 +13,7 @@ class CertificationDefinitionAdmin(admin.ModelAdmin):
@admin.register(Certification)
class CertificationAdmin(admin.ModelAdmin):
search_fields = ['name', 'certification__certification_name', 'certification__department']
autocomplete_fields = ['member']
@admin.register(InstructorOrVendor)