﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22935	Error message in ForeignKey.default_error_messages does not reflect the correct field when 'to_field' is used.	ANUBHAV JOSHI	ANUBHAV JOSHI	"If model be like

{{{
class Person(models.Model):
    name = models.CharField(max_length=30)
class Student(models.Model):
    per = models.ForeignKey(Person, to_field='name')
}}}

Now if `invalid` error comes up from `validate()`, it will be like
`'person instance with pk 'somename' does not exist.'`

It should be:
`'person instance with name 'somename' does not exist.'`"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed		anubhav9042@…	Accepted	1	0	0	0	0	0
