Python IntegrityError/NOT NULL约束失败
“approve\u comment”调用的变量在哪里?Python IntegrityError/NOT NULL约束失败,python,django,model,admin,notnull,Python,Django,Model,Admin,Notnull,“approve\u comment”调用的变量在哪里? 我尝试“python manage.py makemigrations”。但是命令行:“未检测到任何更改”。 我怎样才能解决这个问题?请帮帮我 from django.db import models from django.urls import reverse from tagging.fields import TagField from django.utils import timezone # python2 unicode
我尝试“python manage.py makemigrations”。但是命令行:“未检测到任何更改”。
我怎样才能解决这个问题?请帮帮我
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()
删除屏幕截图——它不会显示完整的错误回溯。相反,请转到“错误”页面并单击“复制和粘贴视图”链接的开关。然后复制该错误消息并粘贴到此处。