My project is written in Django. I have one model for academic articles.
class Article(models.Model):
title = models.CharField(max_length=300)
abstract = models.TextField(blank=True)
...
I have another model for questions that articles may be responsive to:
class Question(models.Model):
question = models.CharField(max_length=300)
article = models.ManyToManyField(Article)
An article can respond to a question in one of three ways: 'yes', 'no', and 'insufficient evidence'. But the same article may respond differently depending on the question. So for example, article1 may respond 'yes' to question1, 'no' to question2 and 'insufficient evidence' to question3.
I'm struggling with how to design these responses into my model. I could create a separate model for responses like below:
class Response(models.Model):
response = models.CharField(max_length=25)
then populate that model with my three responses ('yes', 'no', 'insufficient evidence') and then add a field in my Article model for responses like so:
response = models.ManyToManyField(Response)
But then how would I link an article's response to a question? How do I tell the database that article1's response to question1 is 'yes', its response to question2 is 'no' and its response to question3 is 'insufficient evidence'? Thank you.