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:
Tom Jaster 2015-01-20 22:17:28 +01:00
parent 6ccc45ee47
commit 64c49f8c47

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.to_field
return field.field_name
# URLValidator only accepts `message` in 1.6+