mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20:12 +03:00
to_field is rel.field_name at <1.6. love pdb and pip!
This commit is contained in:
parent
64c49f8c47
commit
a496c523a4
|
@ -158,7 +158,7 @@ if django.VERSION >= (1, 6):
|
||||||
return field.to_fields[0] if len(field.to_fields) else None
|
return field.to_fields[0] if len(field.to_fields) else None
|
||||||
else:
|
else:
|
||||||
def get_to_field(field):
|
def get_to_field(field):
|
||||||
return field.field_name
|
return field.rel.field_name
|
||||||
|
|
||||||
|
|
||||||
# URLValidator only accepts `message` in 1.6+
|
# URLValidator only accepts `message` in 1.6+
|
||||||
|
|
Loading…
Reference in New Issue
Block a user