'blank=True' is not the same as 'null=True' !

Specify 'null=True' and null-values should be allowed on the column (you
should see that in de generated DDL, the clause 'NOT NULL' disappears
from the specs for this column)

That said, your RDBMS might still require you to fill in your foreign
keys, as part of a foreign key constraint, but not knowing your RDBMS
it's hard to say...


Cheers,

--Tim

-----Original Message-----
From: django-users@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Panos Laganakos
Sent: maandag 13 maart 2006 15: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
('test','',NULL)

Although I have specified in its model, that I want to allow the
factor_id to be blank:
class Company(meta.Model):
     33         name = meta.CharField(maxlength=25)
     34         phone = meta.CharField(maxlength=25, blank=True)
     35         factor = meta.ForeignKey(Factor, blank=True)
     36

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to