from rest_framework import serializers from rest_framework.serializers import ListSerializer from power.models import Route, UserRoute class RouteSerializer(serializers.ModelSerializer): class Meta: model = Route list_serializer = ListSerializer fields = '__all__' class UserRouteSerializer(serializers.ModelSerializer): class Meta: model = UserRoute list_serializer = ListSerializer fields = '__all__'