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
37 def __repr__(self): return self.name
38
39 class META:
40 db_table = 'products_companies'
41 verbose_name_plural = 'companies'
42 admin = meta.Admin(
43 list_display = ('name', 'phone',
'factor'),
44 )
Is it mandatory to provide _something_ if I have a Many to One
relation?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---