Multiple ManyToManyField usage and table not found
I have the following class decelerations in my models.py :-
enter code here
class Student(models.Model):
user = models.OneToOneField(User)
current_clubs = models.ManyToManyField('Club',related_name="current")
previous_clubs = models.ManyToManyField('Club',related_name="previous")
class Club(models.Model):
user = models.OneToOneField(User)
students = models.ManyToManyField('Student',related_name="stud")
When I try to view the student or club class from the admin page, (I am
able to create and register Student and Club logins but not view them as
an admin), I see the following error :- DatabaseError at
/admin/school/Club/1/ Django Version is 1.5.1 Exception Type is
DatabaseError Exception Value is no such table: school_club_students
I am unsure as to why such a table was not created by Django when I
created a Club object. If I try to use the admin interface to add a Club,
I run into the same error.
Thanks!
No comments:
Post a Comment