diff options
author | adityacp | 2016-11-18 09:26:57 +0530 |
---|---|---|
committer | adityacp | 2016-11-18 09:26:57 +0530 |
commit | 8795caf686549e793d0e422c328c93832077857f (patch) | |
tree | 3119e7af660e69aeea4f50ec92ecbb74298e67c8 | |
parent | 6f2d4829d15d763177328400d0a1b857b983a770 (diff) | |
download | online_test-8795caf686549e793d0e422c328c93832077857f.tar.gz online_test-8795caf686549e793d0e422c328c93832077857f.tar.bz2 online_test-8795caf686549e793d0e422c328c93832077857f.zip |
Added Hide field in FileUpload
-rw-r--r-- | yaksh/models.py | 7 |
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): |