from rest_framework import serializers
from apps.utils.serializers import CustomModelSerializer
from apps.monitor.models import AuditLog


class DbbackupDeleteSerializer(serializers.Serializer):
    filepaths = serializers.ListField(
        child=serializers.CharField(), label="文件地址列表")


class AuditLogSerializer(CustomModelSerializer):
    change_user_name = serializers.CharField(
        source='change_user.name', read_only=True)

    class Meta:
        model = AuditLog
        fields = '__all__'
