serializers.py 366 B

123456789101112131415
  1. # 序列号定义
  2. from django.contrib.auth.models import User
  3. from rest_framework import serializers
  4. from rest_framework.serializers import ListSerializer
  5. from routes.models import Route
  6. class RoutesSerializer(serializers.ModelSerializer):
  7. class Meta:
  8. model = Route
  9. list_serializer = ListSerializer
  10. fields = '__all__'