I am trying to get the following to work.
Essentially I want to load a number of investors in (users). I then want to load a number of questions in. I want each Investor to answer the questions which are all True/False. The below is what I have on this topic.
Giles
Essentially I want to load a number of investors in (users). I then want to load a number of questions in. I want each Investor to answer the questions which are all True/False. The below is what I have on this topic.
Giles
from django.db import models class Investor(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) def __str__(self): return self.first_name return self.last_name class Question (models.Model): question_text = models.CharField(max_length=100) def __str__(self): return self.question_text class Option (Investor): Question = models.ForeignKey(Question, on_delete=models.CASCADE) Option = models.CharField(max_length=100) Answer = models.BooleanField(default=False)