[Answer]-Dynamically add fields to a ModelForm in Django

1πŸ‘

βœ…

To give you a quick exemple of what I have put in comment (done with notepad, maybe there is typo):

class Comment(models.Model):
    pass

class Review(models.Model):
    comments = models.ManyToManyField(Comment)

class Product(models.Model):
    reviews = models.ManyToManyField(Review)

class Question(models.Model):.
    content = models.TextField(max_length = 500)
    product = models.ForeignKey(Product)

class QuestionAnswer(models.Model):
    content = models.TextField(max_length = 500)
    review = models.ForeignKey(Review)
    question = models.ForeignKey(Question)

Leave a comment