from django.contrib import admin from contacts.models import ConsentRecord, Contact, Suppression class ConsentInline(admin.TabularInline): model = ConsentRecord extra = 0 class SuppressionInline(admin.TabularInline): model = Suppression extra = 0 @admin.register(Contact) class ContactAdmin(admin.ModelAdmin): list_display = ("email", "first_name", "last_name", "phone", "source", "created_at") search_fields = ("email", "first_name", "last_name", "phone") list_filter = ("source",) fields = ( "email", "first_name", "last_name", "phone", "postal_address", "source", "notes", "created_at", "updated_at", ) readonly_fields = ("created_at", "updated_at") inlines = [ConsentInline, SuppressionInline]