mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Merge pull request #2441 from linovia/bugfix/2425
Support for Django 1.8a1
This commit is contained in:
commit
e56f0a928c
|
@ -12,7 +12,7 @@ response content is handled by parsers and renderers.
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from django.db import models
|
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 django.utils.translation import ugettext_lazy as _
|
||||||
from rest_framework.compat import unicode_to_repr
|
from rest_framework.compat import unicode_to_repr
|
||||||
from rest_framework.utils import model_meta
|
from rest_framework.utils import model_meta
|
||||||
|
@ -939,6 +939,9 @@ class ModelSerializer(Serializer):
|
||||||
except FieldDoesNotExist:
|
except FieldDoesNotExist:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if not isinstance(model_field, DjangoField):
|
||||||
|
continue
|
||||||
|
|
||||||
# Include each of the `unique_for_*` field names.
|
# Include each of the `unique_for_*` field names.
|
||||||
unique_constraint_names |= set([
|
unique_constraint_names |= set([
|
||||||
model_field.unique_for_date,
|
model_field.unique_for_date,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user