diff --git a/anatomy/models.py b/anatomy/models.py index a21fabf8..c93d8efa 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -1,3 +1,4 @@ +from django.contrib.contenttypes.fields import GenericRelation from django.db import models from django.utils import timezone @@ -13,7 +14,7 @@ from sortedm2m.fields import SortedManyToManyField import string -from generic.models import Examination, ExamBase +from generic.models import Examination, ExamBase, QuestionNote from collections import defaultdict from helpers.images import image_as_base64 @@ -124,6 +125,8 @@ class AnatomyQuestion(models.Model): related_name="anatomy_authored_questions", ) + notes = GenericRelation(QuestionNote) + class Meta: permissions = () diff --git a/generic/templates/generic/questionnote_form.html b/generic/templates/generic/questionnote_form.html index 30c22400..5592a5b0 100755 --- a/generic/templates/generic/questionnote_form.html +++ b/generic/templates/generic/questionnote_form.html @@ -4,7 +4,7 @@ {% block content %}

Add Feedback

{% csrf_token %} diff --git a/physics/models.py b/physics/models.py index 6e2fc04d..7c22da58 100644 --- a/physics/models.py +++ b/physics/models.py @@ -1,3 +1,4 @@ +from django.contrib.contenttypes.fields import GenericRelation from django.db import models from django.utils import timezone @@ -11,7 +12,7 @@ from django.utils.translation import ugettext_lazy as _ from sortedm2m.fields import SortedManyToManyField -from generic.models import ExamBase +from generic.models import ExamBase, QuestionNote import reversion @@ -102,6 +103,8 @@ class Question(models.Model): Category, on_delete=models.SET_NULL, null=True, blank=True ) + notes = GenericRelation(QuestionNote) + def __str__(self): return self.stem