diff options
author | Prabhu Ramachandran | 2016-11-18 16:24:02 +0530 |
---|---|---|
committer | GitHub | 2016-11-18 16:24:02 +0530 |
commit | d88708631a568c37ae56602407a29001d97a982f (patch) | |
tree | f097d00b3378a7948e6289cdce733a37198bee24 /yaksh/models.py | |
parent | 6f2d4829d15d763177328400d0a1b857b983a770 (diff) | |
parent | 95c8c368d9f34cb05c5edd90f8697ec5d00c5a92 (diff) | |
download | online_test-d88708631a568c37ae56602407a29001d97a982f.tar.gz online_test-d88708631a568c37ae56602407a29001d97a982f.tar.bz2 online_test-d88708631a568c37ae56602407a29001d97a982f.zip |
Merge pull request #158 from adityacp/fix_file_upload_and_tooltip
Fix file upload and tooltip
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 8907df0..2018198 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -65,7 +65,7 @@ test_status = ( ) def get_assignment_dir(instance, filename): - return '%s/%s' % (instance.user.roll_number, instance.assignmentQuestion.id) + return '%s/%s/%s' % (instance.user.user, instance.assignmentQuestion.id, filename) def get_model_class(model): ctype = ContentType.objects.get(app_label="yaksh", model=model) @@ -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 toggle_hide_status(self): + if self.hide: + self.hide = False + else: + self.hide = True + self.save() ############################################################################### class Answer(models.Model): |