From ba094c81305db0ea41d148788cc0867c91fbe55d Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sun, 25 Feb 2018 16:58:41 -0500 Subject: [PATCH] Add initial models for Category and Topic --- events/models/profiles.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/events/models/profiles.py b/events/models/profiles.py index 932917b..0a4ace9 100644 --- a/events/models/profiles.py +++ b/events/models/profiles.py @@ -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()