from django.contrib import admin
from .models import Leads

@admin.register(Leads)
class LeadsAdmin(admin.ModelAdmin):
    list_display = [
        'customer_name',
        'customer_email',
        'customer_phone',
        'lead_for',
        'source',
        'message',
        'created_at',  # Add this if your model has a timestamp field
    ]
    list_display_links = ['customer_name']
    search_fields = ['customer_name', 'customer_email', 'customer_phone', 'lead_for']
    list_filter = ['lead_for', 'property_type', 'status', 'source']
    readonly_fields = ['created_at']  # If you have a created_at field
    fieldsets = (
        ('Lead Information', {
            'fields': (
                'customer_name',
                'customer_email',
                'customer_phone',
                'lead_for',
                'property_type',
                'status',
                'source',
                'message',
            )
        }),
        ('Timestamps', {
            'fields': ('created_at',),
            'classes': ('collapse',),
        }),
    )
    list_per_page = 20