class Incubator(models.Model):
name = models.CharField(max_length=30)
category = models.CharField(max_length=30, blank=True)
acceptanceRate = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
funding = models.IntegerField()
programLength = models.DecimalField(max_digits=4, decimal_places=2)
kloutScore = models.IntegerField(blank=True, null=True)
companies = models.ManyToManyField(Company, blank=True)
def __unicode__(self):
return self.name
当我将任何整数字段留空时,我不断收到一条错误消息,
IntegrityError at /admin/incubators/incubator/add/
incubators_incubator.kloutScore may not be NULL
我想通过设置空白=真和空=真,它会解决这个问题吗?