Tests for list mine/not mine

This commit is contained in:
Scot Hacker 2018-03-26 23:50:14 -07:00
parent dbc379da6a
commit 9d436674db
3 changed files with 47 additions and 19 deletions

View file

@ -17,15 +17,11 @@ class TaskList(models.Model):
def __str__(self):
return self.name
def list_detail(self):
# Count all incomplete tasks on the current list instance
return Item.objects.filter(task_list=self, completed=0)
class Meta:
ordering = ["name"]
verbose_name_plural = "Task Lists"
# Prevents (at the database level) creation of two lists with the same name in the same group
# Prevents (at the database level) creation of two lists with the same slug in the same group
unique_together = ("group", "slug")