Oli*_*Oli 3 python django django-models
我今天疯了.我只是试图插入一个新记录,它扔回"post_blogpost.id可能不是NULL"错误.这是我的模特:
class BlogPost(models.Model):
title = models.CharField(max_length=100)
slug = models.SlugField(max_length=100)
who = models.ForeignKey(User, default=1)
when = models.DateTimeField()
intro = models.TextField(blank=True, null=True)
content = models.TextField(blank=True, null=True)
counter = models.PositiveIntegerField(default=0)
published = models.BooleanField(default=False)
css = models.TextField(blank=True, null=True)
class Meta:
ordering = ('-when', 'id')
Run Code Online (Sandbox Code Playgroud)
模型下面还有许多功能,但我不会在这里完整地包含它们.他们的名字是:content_cache_key,clear_cache,__unicode__,reads,read,processed_content.
我正在通过管理员添加...而且我的头发已经用完了.