summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2016-11-18 09:26:57 +0530
committeradityacp2016-11-18 09:26:57 +0530
commit8795caf686549e793d0e422c328c93832077857f (patch)
tree3119e7af660e69aeea4f50ec92ecbb74298e67c8 /yaksh/models.py
parent6f2d4829d15d763177328400d0a1b857b983a770 (diff)
downloadonline_test-8795caf686549e793d0e422c328c93832077857f.tar.gz
online_test-8795caf686549e793d0e422c328c93832077857f.tar.bz2
online_test-8795caf686549e793d0e422c328c93832077857f.zip
Added Hide field in FileUpload
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 8907df0..fbc527e 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -386,6 +386,7 @@ class FileUpload(models.Model):
file = models.FileField(upload_to=get_upload_dir, blank=True)
question = models.ForeignKey(Question, related_name="question")
extract = models.BooleanField(default=False)
+ hide = models.BooleanField(default=False)
def remove(self):
if os.path.exists(self.file.path):
@@ -401,6 +402,12 @@ class FileUpload(models.Model):
self.extract = True
self.save()
+ def set_hide_status(self):
+ if self.hide:
+ self.hide = False
+ else:
+ self.hide = True
+ self.save()
###############################################################################
class Answer(models.Model):