Thursday, March 31, 2011

idiotic foreignkey error

I have a model with 3 foreignkeys to another model. This has never
been an issue for me before but now it's throwing an error:

<class 'Government.Elections_New.models.Campaign'> has more than 1
ForeignKey to <class 'Government.Elections_New.models.Race'>

My model looks like this:

a_race = models.ForeignKey('Race', related_name='arace', blank=True)
b_race = models.ForeignKey('Race', related_name='arace', blank=True)
c_race = models.ForeignKey('Race', related_name='arace', blank=True):

I must reiterate that this has never been a problem for me before.

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