from django.contrib import admin
from .models import Mosquito, MosqPost, Org, DeviceInfo, WeatherStationInfo


class MosquitoAdmin(admin.ModelAdmin):
    list_display = ('name', 'device_id', 'region')
    list_filter = ('name', 'device_id', 'region')
    ordering = ('name', 'region')


class MosqPostAdmin(admin.ModelAdmin):
    list_display = ('mosq', 'led', 'energy', 'time')
    list_filter = ('mosq', 'time')
    ordering = ['time']


class DeviceAdmin(admin.ModelAdmin):
    list_display = ['device_id', 'device_name', 'org']
    list_filter = ['device_id', 'org']
    ordering = ['device_id']


class OrgAdmin(admin.ModelAdmin):
    list_display = ('name', 'code')
    list_filter = ('name', 'code')
    ordering = ['name']


class WeatherStationAdmin(admin.ModelAdmin):
    list_display = ['device_id', 'device_name', 'org']
    list_filter = ['device_id', 'org']
    ordering = ['device_id']


admin.site.register(Mosquito, MosquitoAdmin)
admin.site.register(MosqPost, MosqPostAdmin)
admin.site.register(DeviceInfo, DeviceAdmin)
admin.site.register(Org, OrgAdmin)
admin.site.register(WeatherStationInfo, WeatherStationAdmin)
