Description

A model with a ForeignKey defining a to_field always results in a new record creation with get_or_create(), as the to_field -setting for is ignored and the initial SELECT uses ForeignKey's primary_key. The Field defined with to_field does not even have the same Field -type (IntegerField looked up against CharField).