-1

我正在做这个项目:https ://github.com/mirumee/saleor

我想在产品表中添加一个“user_id”列。因此,我将以下代码添加到第 248 行 https://github.com/mirumee/saleor/blob/master/saleor/product/models.py#L248

account_user = models.ForeignKey(
    Account_User,
    related_name="products",
    on_delete=models.CASCADE,
 )

但是,Django 说“NameError: name 'Account_User' is not defined”。我该如何解决这个问题?谢谢

4

1 回答 1

0
from ..account.models import User

account_user = models.ForeignKey(
User,
related_name="products",
on_delete=models.CASCADE)
于 2020-09-10T04:18:43.290 回答