.
This commit is contained in:
@@ -101,6 +101,16 @@ class ExamBase(models.Model):
|
|||||||
def get_question_index(self, question):
|
def get_question_index(self, question):
|
||||||
return list(self.exam_questions.all()).index(question)
|
return list(self.exam_questions.all()).index(question)
|
||||||
|
|
||||||
|
def get_authors(self):
|
||||||
|
"""Returns a comma seperated text list of authors"""
|
||||||
|
authors = ", ".join([i.username for i in self.author.all()])
|
||||||
|
return authors
|
||||||
|
|
||||||
|
def get_author_objects(self):
|
||||||
|
"""Returns a comma seperated text list of authors"""
|
||||||
|
authors = [i for i in self.author.all()]
|
||||||
|
return authors
|
||||||
|
|
||||||
class NoteType(models.Model):
|
class NoteType(models.Model):
|
||||||
note_type = models.CharField(max_length=200)
|
note_type = models.CharField(max_length=200)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user