summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-03-21 18:19:39 +0530
committerGitHub2018-03-21 18:19:39 +0530
commit3226e8f455d51967c29171d601783ea4de88306a (patch)
treeb7f5e862e9bcf34a7b07a346015c6d557e148da8 /yaksh/models.py
parentcb6b1aad8f77035d1bfb598d8b70c51c23c435d7 (diff)
parentd015f6e34d67ac71814f91f99d2bbdfa3458f3cc (diff)
downloadonline_test-3226e8f455d51967c29171d601783ea4de88306a.tar.gz
online_test-3226e8f455d51967c29171d601783ea4de88306a.tar.bz2
online_test-3226e8f455d51967c29171d601783ea4de88306a.zip
Merge pull request #450 from adityacp/change_student_dashboard
Student Dashboard Changes
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 08dac7c..d9eea57 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -772,6 +772,14 @@ class Course(models.Model):
percent = round((count / len(modules)))
return percent
+ def days_before_start(self):
+ """ Get the days remaining for the start of the course """
+ if timezone.now() < self.start_enroll_time:
+ remaining_days = (self.start_enroll_time - timezone.now()).days + 1
+ else:
+ remaining_days = 0
+ return remaining_days
+
def __str__(self):
return self.name