Change ForeignKey(to=...) to use strings rather than direct references.