From a496c523a453ec80001073b95b3e24d8c5ce12d7 Mon Sep 17 00:00:00 2001 From: Tom Jaster Date: Tue, 20 Jan 2015 22:32:58 +0100 Subject: [PATCH] to_field is rel.field_name at <1.6. love pdb and pip! --- rest_framework/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 82ad0ea93..ca99f19e1 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -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.field_name + return field.rel.field_name # URLValidator only accepts `message` in 1.6+