Commit 8f25c0c5 by Tom Christie

Add 1.8 support

parent 39f26c9e
......@@ -12,7 +12,7 @@ response content is handled by parsers and renderers.
"""
from __future__ import unicode_literals
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.db.models.fields import FieldDoesNotExist, Field as DjangoModelField
from django.utils.translation import ugettext_lazy as _
from rest_framework.compat import unicode_to_repr
from rest_framework.utils import model_meta
......@@ -1231,7 +1231,9 @@ class ModelSerializer(Serializer):
continue
try:
model_fields[source] = model._meta.get_field(source)
field = model._meta.get_field(source)
if isinstance(field, DjangoModelField):
model_fields[source] = field
except FieldDoesNotExist:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment