serializer.py 579 B

1234567891011121314151617181920
  1. from rest_framework import serializers
  2. from rest_framework.serializers import ListSerializer
  3. from pivottable.models import Payment, Menu
  4. class PaymentSerializer(serializers.ModelSerializer):
  5. class Meta:
  6. model = Payment
  7. # fields = ['url', 'username', 'email', 'is_staff']
  8. list_serializer = ListSerializer
  9. fields = '__all__'
  10. class MenuSerializer(serializers.ModelSerializer):
  11. class Meta:
  12. model = Menu
  13. # fields = ['url', 'username', 'email', 'is_staff']
  14. list_serializer = ListSerializer
  15. fields = '__all__'