1.ForeignKey-->on_delete=models.CASCASE(or None,DO_NOTHING,PROTECT,SET_NULL,SET_DEFAULT,SET())
For Example:
customer = models.ForeignKey("Customer",on_delete=models.CASCADE)
2.OneToOneField--ditto
user = models.OneToOneField(User,on_delete=models.CASCADE)
3.ManyToManyField-->Don‘t need!
TypeError: __init__() missing 1 required positional argument: 'on_delete'
原文:https://www.cnblogs.com/DotSDot/p/13204974.html