执行makemigrations后,结果

时间:2015-08-31 09:11:16

标签: python sql django django-models orm

型号名称是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)),
            ],
        ),
    ]

我想知道titlesubtitle在哪里。

1 个答案:

答案 0 :(得分:1)

我在模型字段后删除了逗号,并得到了正确的结果。