You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
423 B
13 lines
423 B
from rest_framework import serializers
|
|
from ..models import Menu
|
|
|
|
|
|
class MenuSerializer(serializers.ModelSerializer):
|
|
"""
|
|
菜单序列化
|
|
"""
|
|
|
|
class Meta:
|
|
model = Menu
|
|
fields = ("id", "name", "route_name", "icon", "path", "is_show", "is_frame", "sort", "component", "pid", "label")
|
|
extra_kwargs = {"name": {"required": True, "error_messages": {"required": "必须填写菜单名"}}}
|
|
|