add topics and branches

This commit is contained in:
Fred Pauchet 2016-12-08 14:52:33 +01:00
parent 3955461dc0
commit 814be93f90
1 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,20 @@ class Context(models.Model):
def __str__(self):
return self.name
class Topic(models.Model):
"""Describes a topic; it is linked to several projects/contexts and has a tracker to see
what has been done."""
name = models.CharField(max_length=255)
projects = models.ManyToManyField('Project', related_name='topics')
contexts = models.ManyToManyField('Context', related_name='topics')
class Branch(models.Model):
"""Describes a branch (ie. an option) inside a topic."""
name = models.CharField(max_length=255)
topic = models.ForeignKey(Topic)
class Task(models.Model):
"""
Describes something that has to be done.