型号名称是Question,这是代码。
from django.db import models
class Question(models.Model):
id = models.AutoField(primary_key=True),
title = models.CharField(max_length=255),
subtitle = models.CharField(max_length=255),
publishedAt = models.DateTimeField(auto_now_add=True)
执行命令后
python manage.py makemigrations questions
我得到了结果
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Deal',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('publishedAt', models.DateTimeField(auto_now_add=True)),
],
),
]
我想知道title
和subtitle
在哪里。
答案 0 :(得分:1)
我在模型字段后删除了逗号,并得到了正确的结果。