django.db.models.fields.related.ForeignObject.__init__() got multiple values for keyword argument 'to_fields'
原因:使用了to_fields
说明:使用外键关联字段时,应该使用to_field
,而不是to_fields
错误示例:
worker = models.ForeignKey(verbose_name="负责人",to="UserInfo",to_fields="name",on_delete=models.CASCADE)
正确示例:
worker = models.ForeignKey(verbose_name="负责人",to="UserInfo",to_fields="name",on_delete=models.CASCADE)
标签:multiple,name,keyword,models,fields,argument,got
From: https://www.cnblogs.com/Rev-RoastDuck/p/17128972.html