summaryrefslogtreecommitdiff
path: root/website/models.py
diff options
context:
space:
mode:
authorAkshen2018-10-31 11:13:21 +0530
committerAkshen2018-10-31 11:13:21 +0530
commit529c9b63bfe2ee7d6fe1667bf5c09a0b23ac374f (patch)
tree87f5099735d814f89831d91b606f038e02468471 /website/models.py
parent7d171e9b3dfdf6119f719ae7283add795bd1ec6c (diff)
downloadnccps-2018-529c9b63bfe2ee7d6fe1667bf5c09a0b23ac374f.tar.gz
nccps-2018-529c9b63bfe2ee7d6fe1667bf5c09a0b23ac374f.tar.bz2
nccps-2018-529c9b63bfe2ee7d6fe1667bf5c09a0b23ac374f.zip
Allow participants to view and download solutions
- view correct answers - download all dwsim files - remove 10 marks week
Diffstat (limited to 'website/models.py')
-rw-r--r--website/models.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/website/models.py b/website/models.py
index e482453..ad6b3e4 100644
--- a/website/models.py
+++ b/website/models.py
@@ -36,10 +36,6 @@ def get_document_dir(instance, filename):
return '%s/attachment/%s/%s.%s' % (instance.user, instance.proposal_type, fname+'_'+str(instance.user), fext)
-def attachments(instance, filename):
- return os.sep.join((instance.workshoptype_name.replace(" ", '_'), filename))
-
-
class Proposal(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE,)
name_of_authors = models.CharField(max_length=200, default='None')
@@ -121,6 +117,9 @@ class Question(models.Model):
# The date for the question.
question_day = models.DateField()
+ def __str__(self):
+ return u"{0} || {1}".format(self.correct_answer, self.question_day)
+
class AnswerPaper(models.Model):
@@ -131,8 +130,7 @@ class AnswerPaper(models.Model):
#To upload model for each question
-'''
+
class UploadModel(models.Model):
- question = models.ForeignKey(Question, on_delete=models.CASCADE, blank=True, null=True)
- model_file = models.FileField(upload_to=attachments)
-''' \ No newline at end of file
+ question = models.ForeignKey(Question, on_delete=models.CASCADE, blank=True)
+ model_file = models.FileField(upload_to='uploads/')