Hi,

I have the following model which has a foreign key field that I would
like to be null at times:

class Car(models.Model):
    make = models.CharField(maxlength=100, core=True)
    model = models.CharFeild(maxlength=100, core=True)
    date = models.DateTimeField(auto_now_add=True)
    forum = models.ForeignKey(Forum, blank=True, null=True)

Even with the "blank=True" and "null=True" arguments it still will not
allow inserts.  I've tried a combination of these two arguments (just
one or the other) and that didn't work either.  I found the following
post and it seemed to work for them so I'm wondering if anyone can see
the problem with my situation.

http://groups.google.com/group/django-users/browse_thread/thread/ff921044d994f336/a42316a8049e8c6d?q=null+foreign+key&rnum=10#a42316a8049e8c6d

The admin is kicking back the following error:

ERROR: null value in column "forum_id" violates not-null constraint
INSERT INTO "search_car" ("make","model","date","forum_id") VALUES
('VW','Jetta','2006-06-27 23

Thanks in advance!

Andy


--~--~---------~--~----~------------~-------~--~----~
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