我正在使用social-auth-app-django==2.1.0
,并试图在我的models.py中创建一个使用用户作为外键的模型。我已经查看了文档,但找不到任何与此相关的内容。所以现在我的models.py看起来是这样的:
class Deck(models):
deck_name = models.CharField(max_length=30)
user_id = models.ForeignKey(USER_MODEL ) #what do I type here?
class Card(models):
card_back = models.CharField(max_length=150)
card_front = models.CharField(max_length=150)
card_strength = models.IntegerField()
card_last_trained = models.DateTimeField()
deck = models.ForeignKey(Deck, on_delete=models.CASCADE)
转载请注明出处:http://www.tiantaijiaoyu.com/article/20230526/1936751.html