IntegrityError / NOT NULL约束失败

时间:2018-11-26 03:47:27

标签: python django model admin notnull

“ approve_comment”调用的变量在哪里?
我尝试'python manage.py makemigrations'。但是命令行:“未检测到更改”。
我该怎么解决这个问题?请帮帮我...

error screenshot

from django.db import models
from django.urls import reverse
from tagging.fields import TagField
from django.utils import timezone

# python2 unicode
from django.utils.encoding import python_2_unicode_compatible

@python_2_unicode_compatible
class Post(models.Model):
    title = models.CharField('TITLE', max_length=50)
    slug = models.SlugField('SLUG', unique=True, allow_unicode=True, help_text='one word for title alias.')
    description = models.CharField('DESCRIPTION', max_length=100, blank=True, help_text='simple description text.')
    content = models.TextField('CONTENT')
    create_date = models.DateTimeField('Create Date', auto_now_add=True)
    modify_date = models.DateTimeField('Modify Date', auto_now=True)
    tag = TagField()

class Meta:
    verbose_name = 'post'
    verbose_name_plural = 'posts'
    db_table = 'my_post'
    ordering = ('-modify_date',)

def __str__(self):
    return self.title

def get_absolute_url(self):
    return reverse('blog:post_detail', args=(self.slug, ))

def get_previous_post(self):
    return self.get_previous_by_modify_date()

def get_next_post(self):
    return self.get_next_by_modify_date()

0 个答案:

没有答案
相关问题