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
When i leave any of the integerfields blank, i keep getting an error that says,
IntegrityError at /admin/incubators/incubator/add/
incubators_incubator.kloutScore may not be NULL
I thought by putting blank=true and null=true, it would solve that problem?
it's because I added "blank=true" and "null=true" after i already created the databases. I had to delete my db and then "syncdb" and then it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With