Actually, you pretty much nailed it.
It’s a reference to a row in another table.
Normally, you refer to rows via their primary key. So the FK in one table is an int that matches the PK of the table to which it refers.
The to_name clause changes that. Instead of referring to the PK, it can refer to any field that is unique in the table. In a majority of cases, this tends to be a bad idea. (There are a number of cases where it’s appropriate to do this, but they tend to be few and far between.)
However, the key point here is that you’ve got your FK referring to a non-PK field. This non-PK field is a different data type than the PK.
This brings us back to an earlier response (Check if record exists in model - #26 by KenWhitesell)
My primary recommendation is to eliminate the to_field attribute of that FK specification.
Now, since this is going to change the data type of the underlying column, you will need to do a makemigrations / migrate to make the database match your model.
Hopefully, you don’t have any data in that table that you’re concerned about.
If you have any existing data in that table that you want to keep, the situation has now become a lot more complicated. Let me know if that’s the case, and I’ll give you an outline of the steps you need to take to actually accomplish this.