summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2017-04-27 18:37:19 +0530
committeradityacp2017-04-27 18:37:19 +0530
commit624e752684125aa525d9b3643cbd7c9b7ba61682 (patch)
tree726da35ba55acacfde255e31bdc2233600f75395 /yaksh/models.py
parentb191455c7d9b0f6c3548da174a68c8ab8052abf0 (diff)
parent2694fd6dd4d37a1a6570792e234998feef21edca (diff)
downloadonline_test-624e752684125aa525d9b3643cbd7c9b7ba61682.tar.gz
online_test-624e752684125aa525d9b3643cbd7c9b7ba61682.tar.bz2
online_test-624e752684125aa525d9b3643cbd7c9b7ba61682.zip
Remove conflicts from views after rebase
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 77b5ec4..f6867f0 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -49,7 +49,7 @@ question_types = (
enrollment_methods = (
("default", "Enroll Request"),
- ("open", "Open Course"),
+ ("open", "Open Enrollment"),
)
test_case_types = (
@@ -112,6 +112,8 @@ class CourseManager(models.Manager):
trial_course.enroll(False, user)
return trial_course
+ def get_hidden_courses(self, code):
+ return self.filter(code=code, hidden=True)
###############################################################################
class Course(models.Model):
@@ -119,6 +121,8 @@ class Course(models.Model):
name = models.CharField(max_length=128)
enrollment = models.CharField(max_length=32, choices=enrollment_methods)
active = models.BooleanField(default=True)
+ code = models.CharField(max_length=128, null=True, blank=True)
+ hidden = models.BooleanField(default=False)
creator = models.ForeignKey(User, related_name='creator')
students = models.ManyToManyField(User, related_name='students')
requests = models.ManyToManyField(User, related_name='requests')