serializers.py 423 B

123456789101112
  1. from __future__ import print_function, unicode_literals
  2. import rest_framework
  3. # import appropriate mixins depending on the DRF version
  4. # this allows to maintain clean code for each DRF version
  5. # without doing any magic
  6. # a little more code but a lit clearer what is going on
  7. if str(rest_framework.__version__).startswith('2'):
  8. from .drf2.serializers import * # noqa
  9. else:
  10. from .drf3.serializers import * # noqa