serializers.py 475 B

12345678910111213
  1. from __future__ import print_function, unicode_literals
  2. from rest_framework.serializers import ModelSerializer
  3. from rest_framework_bulk.serializers import BulkListSerializer, BulkSerializerMixin
  4. from .models import SimpleModel
  5. class SimpleSerializer(BulkSerializerMixin, # only required in DRF3
  6. ModelSerializer):
  7. class Meta(object):
  8. model = SimpleModel
  9. # only required in DRF3
  10. list_serializer_class = BulkListSerializer