Friday, May 28, 2010

makeing a foreign key optional

Hey,

i want to have an optional foreign key in my model. I tried sth like
this:
person = models.ForeignKey('Person',
related_name="kontakt",blank=True,null=True)
If I try to add a new object in the admin interface it is always
complaining that i have no value selected in the person field.

What am I doing wrong here?

Thx
Sebastian

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment