summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authoradityacp2016-04-26 19:00:01 +0530
committeradityacp2016-04-26 19:00:01 +0530
commit5d92e6fac7901c9829a759aec539e603dfb66038 (patch)
tree28b4f46c254fd2611660be1c75ef46e246b528d9 /yaksh/models.py
parent825f8464ef1b2853c029cc23bf7fb89f6a9c1c09 (diff)
downloadonline_test-5d92e6fac7901c9829a759aec539e603dfb66038.tar.gz
online_test-5d92e6fac7901c9829a759aec539e603dfb66038.tar.bz2
online_test-5d92e6fac7901c9829a759aec539e603dfb66038.zip
rebase changes
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 9b92791..65b4dc0 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -71,6 +71,8 @@ class Course(models.Model):
requests = models.ManyToManyField(User, related_name='requests')
rejected = models.ManyToManyField(User, related_name='rejected')
created_on = models.DateTimeField(auto_now_add=True)
+ teachers = models.ManyToManyField(User, related_name='teachers')
+
def request(self, *users):
self.requests.add(*users)
@@ -116,6 +118,9 @@ class Course(models.Model):
def deactivate(self):
self.active = False
+ def add_teachers(self, *users):
+ self.teachers.add(*users)
+
def __unicode__(self):
return self.name