to_field is rel.field_name at <1.6. love pdb and pip!

This commit is contained in:
Tom Jaster 2015-01-20 22:32:58 +01:00
parent 64c49f8c47
commit a496c523a4

View File

@ -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+