From 8795caf686549e793d0e422c328c93832077857f Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 18 Nov 2016 09:26:57 +0530 Subject: Added Hide field in FileUpload --- yaksh/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'yaksh/models.py') 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): -- cgit