diff options
| author | Tom Christie | 2015-01-23 09:50:10 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-01-23 09:50:10 +0000 |
| commit | e56f0a928c7ec6af15a283fc48a7dded31a7d113 (patch) | |
| tree | 13596e0896d83835586fb503de0d03a9bdf1b8b9 | |
| parent | 0b91714100d961d6ceb3228e175445212ade3e10 (diff) | |
| parent | 15f797fd3ec61947aaecc05e6fd040e1e3e8776a (diff) | |
| download | django-rest-framework-e56f0a928c7ec6af15a283fc48a7dded31a7d113.tar.bz2 | |
Merge pull request #2441 from linovia/bugfix/2425
Support for Django 1.8a1
| -rw-r--r-- | rest_framework/serializers.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 6320a075..cf797bdc 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -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 DjangoField from django.utils.translation import ugettext_lazy as _ from rest_framework.compat import unicode_to_repr from rest_framework.utils import model_meta @@ -939,6 +939,9 @@ class ModelSerializer(Serializer): except FieldDoesNotExist: continue + if not isinstance(model_field, DjangoField): + continue + # Include each of the `unique_for_*` field names. unique_constraint_names |= set([ model_field.unique_for_date, |
