# address/admin.py
from django.contrib import admin
from .models import Address

@admin.register(Address)
class AddressAdmin(admin.ModelAdmin):
    list_display = ('tenant', 'hostel','address_line', 'city', 'state', 'postal_code', 'country')  # Columns displayed in the admin list view
    search_fields = ('tenant__name', 'hostel__name', 'city', 'state')  # Allow searching by hostel name, city, and state
    list_filter = ('state', 'state', 'city')  # Add filters in the right panel
    readonly_fields = ('tenant', 'hostel', 'country')  # Make tenant and hostel read-only
