diff options
author | mahesh | 2018-02-07 18:49:08 +0530 |
---|---|---|
committer | mahesh | 2018-02-07 19:12:48 +0530 |
commit | 2c53d636aa4a3f36586910e1d3ef5276a7efc337 (patch) | |
tree | 001129b91cce31f3cadcfce6921a7383d9a669b7 /yaksh/models.py | |
parent | 782fd83b5931efde8ae26795c65e952df5012d0f (diff) | |
download | online_test-2c53d636aa4a3f36586910e1d3ef5276a7efc337.tar.gz online_test-2c53d636aa4a3f36586910e1d3ef5276a7efc337.tar.bz2 online_test-2c53d636aa4a3f36586910e1d3ef5276a7efc337.zip |
Add course as a unique constraint
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 6a7b800..46cf603 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1496,7 +1496,9 @@ class AnswerPaper(models.Model): objects = AnswerPaperManager() class Meta: - unique_together = ('user', 'question_paper', 'attempt_number') + unique_together = ('user', 'question_paper', + 'attempt_number', "course" + ) def get_per_question_score(self, question_id): if question_id not in self.get_questions().values_list('id', flat=True): |