mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
From this i believe it is field_name pre django 1.6. I still don’t have django 1.5 installed so it is an educated guess by looking
at ManyToOneRel and ForeignKey https://github.com/django/django/blob/stable/1.5.x/django/db/models/fields/related.py#L915
This commit is contained in:
parent
6ccc45ee47
commit
64c49f8c47
|
@ -158,7 +158,7 @@ if django.VERSION >= (1, 6):
|
|||
return field.to_fields[0] if len(field.to_fields) else None
|
||||
else:
|
||||
def get_to_field(field):
|
||||
return field.to_field
|
||||
return field.field_name
|
||||
|
||||
|
||||
# URLValidator only accepts `message` in 1.6+
|
||||
|
|
Loading…
Reference in New Issue
Block a user