serializer.py 595 B

1234567891011121314151617181920212223
  1. from rest_framework import serializers
  2. from rest_framework.serializers import ListSerializer
  3. from relation.models import *
  4. class DaptSerializer(serializers.ModelSerializer):
  5. class Meta:
  6. model = Dapt
  7. fields = '__all__'
  8. class PostSerializer(serializers.ModelSerializer):
  9. class Meta:
  10. model = Post
  11. fields = '__all__'
  12. class UserSerializer(serializers.ModelSerializer):
  13. class Meta:
  14. model = User
  15. fields = '__all__'
  16. class DaptUserSerializer(serializers.ModelSerializer):
  17. class Meta:
  18. model = DaptUser
  19. fields = '__all__'