add some tests and views
This commit is contained in:
@@ -1523,3 +1523,23 @@ class ExamCollection(models.Model):
|
||||
|
||||
date = models.DateField(blank=True,null=True)
|
||||
|
||||
author = models.ManyToManyField(
|
||||
settings.AUTH_USER_MODEL,
|
||||
blank=True,
|
||||
help_text="Author/Manager(s) of the exam collection",
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name} [{self.date}]"
|
||||
|
||||
def get_author_objects(self):
|
||||
"""Returns a comma seperated text list of authors"""
|
||||
authors = [i for i in self.author.all()]
|
||||
return authors
|
||||
|
||||
def get_authors(self):
|
||||
"""Returns a comma seperated text list of authors"""
|
||||
authors = ", ".join([i.username for i in self.author.all()])
|
||||
if not authors:
|
||||
return "None"
|
||||
return authors
|
||||
Reference in New Issue
Block a user