summaryrefslogtreecommitdiff
path: root/website/models.py
diff options
context:
space:
mode:
authorAkshen2018-10-25 10:19:35 +0530
committerAkshen2018-10-25 10:19:35 +0530
commit828c98ffe0ef74ce7abc92339c9a0849cafd2634 (patch)
treeaed2b4fe55e77650b02d8a9c1725b0668a2399ad /website/models.py
parentd4ba84f1ef0d74ef5878f7590fde56444b01d438 (diff)
downloadnccps-2018-828c98ffe0ef74ce7abc92339c9a0849cafd2634.tar.gz
nccps-2018-828c98ffe0ef74ce7abc92339c9a0849cafd2634.tar.bz2
nccps-2018-828c98ffe0ef74ce7abc92339c9a0849cafd2634.zip
Update marks for week 3 and 4
- 5 marks for week 3 - 10 marks for week 4 13th and 14th TBA - Upload Model for each question TBD
Diffstat (limited to 'website/models.py')
-rw-r--r--website/models.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/website/models.py b/website/models.py
index 2481177..e482453 100644
--- a/website/models.py
+++ b/website/models.py
@@ -34,7 +34,11 @@ def get_document_dir(instance, filename):
fname, fext = os.path.splitext(filename)
# print "----------------->",instance.user
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,)
@@ -123,4 +127,12 @@ class AnswerPaper(models.Model):
participant = models.ForeignKey(Profile, on_delete=models.CASCADE)
answered_q = models.ForeignKey(Question, on_delete=models.CASCADE)
validate_ans = models.BooleanField()
- date = models.DateTimeField(auto_now=True) \ No newline at end of file
+ date = models.DateTimeField(auto_now=True)
+
+
+#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