from rest_framework import serializers
from ..models import Menu


class MenuSerializer(serializers.ModelSerializer):
    """
    菜单序列化
    """

    class Meta:
        model = Menu
        fields = ('id', 'name','is_frame', 'sort', 'pid', 'type','method')
        extra_kwargs = {'name': {'required': True, 'error_messages': {'required': '必须填写名称'}}}
