暂无描述

admin.py 1.8KB

    # -*- coding: utf-8 -*- from django.contrib import admin from django_admin import ReadOnlyModelAdmin, Readonly2ModelAdmin from logs.models import MchInfoDecryptLogInfo, MchInfoEncryptLogInfo, MchLogInfo, RedpackSendLogInfo class MchInfoEncryptLogInfoAdmin(Readonly2ModelAdmin, admin.ModelAdmin): list_display = ('plaintext', 'alg', 'ciphertext', 'brand_pk', 'model_pk', 'distributor_pk', 'sn', 'operator_id', 'is_send_redpack', 'redpack_amount', 'redpack_max_amount', 'has_send_redpack', 'redpack_send_amount', 'user_id', 'nickname', 'status', 'created_at', 'updated_at') list_filter = ('alg', 'brand_pk', 'model_pk', 'distributor_pk', 'operator_id', 'is_send_redpack', 'has_send_redpack', 'status') readonly_fields_exclude = ('is_send_redpack', 'redpack_amount', 'redpack_max_amount') class MchInfoDecryptLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): list_display = ('ciphertext', 'brand_pk', 'model_pk', 'distributor_pk', 'sn', 'decrypt_count', 'status', 'created_at', 'updated_at') list_filter = ('brand_pk', 'model_pk', 'distributor_pk', 'status') class MchLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): list_display = ('log_id', 'log_file', 'operator_id', 'app_version', 'status', 'created_at', 'updated_at') list_filter = ('operator_id', 'app_version', 'status') search_fields = ('operator_id', 'app_version') class RedpackSendLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): list_display = ('brand_id', 'user_id', 'nickname', 'phone', 'sn', 'redpack_type', 'redpack_amount', 'status', 'created_at', 'updated_at') admin.site.register(MchInfoDecryptLogInfo, MchInfoDecryptLogInfoAdmin) admin.site.register(MchInfoEncryptLogInfo, MchInfoEncryptLogInfoAdmin) admin.site.register(MchLogInfo, MchLogInfoAdmin) admin.site.register(RedpackSendLogInfo, RedpackSendLogInfoAdmin)