Add initial models for Category and Topic

This commit is contained in:
Michael Hall 2018-02-25 16:58:41 -05:00
parent ba69749cc5
commit ba094c8130

View file

@ -198,3 +198,13 @@ class Member(models.Model):
def __str__(self):
return '%s in %s' % (self.user, self.team)
class Category(models.Model):
name = models.CharField(max_length=256)
description = models.TextField()
img = models.URLField(blank=False, null=False)
class Topic(models.Model):
category = models.ForeignKey(Category, on_delete=models.CASCADE, null=False, blank=False)
name = models.CharField(max_length=256)
description = models.TextField()