I'm doing a MCQ question/answers db schema. But this gave me an error. I'm pulling my hair on this one.
"Could not determine join condition between parent/child tables on relationship Question.options - there are multiple foreign key paths linking the tables. Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference to the parent table."
class Question(db.Model):
tablename = 'question'
id = db.Column(db.Integer, primary_key=True)
question_text = db.Column(db.Text)
correct_option_id = db.Column(db.Integer, db.ForeignKey('option.id'))
options = db.relationship('Option', backref='question', lazy='dynamic')
class Option(db.Model):
tablename = 'option'
id = db.Column(db.Integer, primary_key=True)
question_id = db.Column(db.Integer, db.ForeignKey('question.id'))
option_text = db.Column(db.Text)