# -*- coding: utf-8 -*-

from django.contrib import admin
from django_admin import ReadOnlyModelAdmin

from statistic.models import (DistributorSaleStatisticInfo, ModelSaleStatisticInfo, ProvinceSaleStatisticInfo,
                              RegisterStatisticInfo, SaleStatisticInfo)


class RegisterStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('ymd', 'num', 'status', 'created_at', 'updated_at')
    search_fields = ('ymd', )


class SaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('ymd', 'num', 'status', 'created_at', 'updated_at')
    search_fields = ('ymd', )


class ModelSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('model_id', 'model_name', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('model_name', 'status')
    search_fields = ('model_id', 'model_name', 'ymd')


class DistributorSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('distributor_id', 'distributor_name', 'ymd', 'num', 'status', 'created_at', 'updated_at')
    list_filter = ('distributor_name', 'status')
    search_fields = ('distributor_id', 'distributor_name', 'ymd')


class ProvinceSaleStatisticInfoAdmin(admin.ModelAdmin):
    list_display = ('province_code', 'province_name', 'ymd', 'num', 'position', 'status', 'created_at', 'updated_at')
    list_filter = ('province_code', 'province_name', 'status')
    search_fields = ('province_code', 'province_name', 'ymd')


admin.site.register(RegisterStatisticInfo, RegisterStatisticInfoAdmin)
admin.site.register(SaleStatisticInfo, SaleStatisticInfoAdmin)
admin.site.register(ModelSaleStatisticInfo, ModelSaleStatisticInfoAdmin)
admin.site.register(DistributorSaleStatisticInfo, DistributorSaleStatisticInfoAdmin)
admin.site.register(ProvinceSaleStatisticInfo, ProvinceSaleStatisticInfoAdmin)
