>From the http://code.djangoproject.com/wiki/NewbieMistakes
Problem ΒΆ
When you have a Field: current_zip =
meta.IntegerField(maxlength=5,blank=True)
django will create a not nullable field in the DB. However leaving the
field blank (in admin/web) django will try and insert a NULL value in
the D
Hey Tim,
Yeah, I understand what you mean, but I thought that django used "" by
default and not NULL. That's why I defined in my model to allow blank,
and not include null=True.
Part of the model is this:
class Factor(meta.Model):
20 first_name = meta.CharField(maxlength=25)
21
:34
To: Django users
Subject: Integrity Error, regarding NULL values
Hello,
I am getting an IntegrityError:
ERROR: null value in column "factor_id" violates not-null constraint
INSERT INTO "products_companies" ("name","phone","factor_id") VALUES
(
Hello,
I am getting an IntegrityError:
ERROR: null value in column "factor_id" violates not-null constraint
INSERT INTO "products_companies" ("name","phone","factor_id") VALUES
('test','',NULL)
Although I have specified in its model, that I want to allow the
factor_id to be blank:
class Company(
4 matches
Mail list logo