from django.db import models in models.py but in command prompt i got NameError: name 'model' is not defined

from django.db import models in models.py but in command prompt i got NameError: name 'model' is not defined

我收到了这个错误: 文件“C:\Users\jiri.svab\Documents\Pipenv\Django\DennisIvy\ecommerce\store\models.py”,第 15 行,位于 class 产品(models.Model): 文件“C:\Users\jiri.svab\Documents\Pipenv\Django\DennisIvy\ecommerce\store\models.py”,第 16 行,在产品中 名称 = model.CharField(max_length=200, null=True) NameError: 名称 'model' 未定义

但是在我的“models.py”的第一行我导入了模型:

from django.db import models
from django.contrib.auth.models import User

# Create your models here.

class Customer(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, blank=True)
    name = models.CharField(max_length=200, null=True)
    email = models.CharField(max_length=200, null=True)

    def __str__(self):
        return self.name

请问我应该寻找什么线索?

谢谢

您没有显示 models.py 文件的其余部分,但它似乎是您的 Product 模型 class 定义中的错字。在 name = model.CharField(max_length=200, null=True) 行中,从 model 更改为 models