from django.contrib import admin
from .models import NominationPlace

@admin.register(NominationPlace)
class NominationPlaceAdmin(admin.ModelAdmin):
    list_display = ('display_name', 'lat', 'lon', 'country', 'city', 'has_bounding_box')
    search_fields = ('display_name', 'city', 'state', 'postcode')
    list_filter = ('country', 'state', 'city')

    def has_bounding_box(self, obj):
        return bool(obj.boundingbox)
    has_bounding_box.boolean = True
    has_bounding_box.short_description = "Has Bounding Box"
