Friday, January 3, 2014

ForeignKey pointing to "nothing"

I have a model where a foreign key reference may be undefined when a  record is first created. In particular, I have the following in my model   seller = models.ForeignKey(User, related_name='+', blank=True,       null=True)    The form accepts not setting the seller field but I get an Integrity  Error exception when I attempt to save it that says      escrow_escrow.seller_id may not be NULL    I am using SQLite. What did I miss?  

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7a545abf-6dde-4eb4-9e66-6d6f990e5521%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment