Commit 546084b41dc30d523cfcb045945c9f0d77c4597d
1 parent
c7c5eb2d
Exists in
master
and in
5 other branches
Adding Forum foreign key [Issue: #82]
Showing
1 changed file
with
1 additions
and
3 deletions
Show diff stats
forum/models.py
... | ... | @@ -17,7 +17,6 @@ class Forum(Activity): |
17 | 17 | class Meta: |
18 | 18 | verbose_name = _('Forum') |
19 | 19 | verbose_name_plural = _('Foruns') |
20 | - app_label = 'forum' | |
21 | 20 | |
22 | 21 | def __str__(self): |
23 | 22 | return self.title |
... | ... | @@ -29,11 +28,11 @@ class Post(models.Model): |
29 | 28 | user = models.ForeignKey(User, verbose_name = _('Autor')) |
30 | 29 | message = models.TextField(_('Post message'), blank = False) |
31 | 30 | post_date = models.DateTimeField(_('Post Date'), auto_now_add = True) |
31 | + forum = models.ForeignKey(Forum, _('Forum')) | |
32 | 32 | |
33 | 33 | class Meta: |
34 | 34 | verbose_name = _('Post') |
35 | 35 | verbose_name_plural = _('Posts') |
36 | - app_label = 'forum' | |
37 | 36 | |
38 | 37 | def __str__(self): |
39 | 38 | return ''.join([self.user.name, " / ", self.post_date]) |
... | ... | @@ -50,7 +49,6 @@ class PostAnswer(models.Model): |
50 | 49 | class Meta: |
51 | 50 | verbose_name = _('Post Answer') |
52 | 51 | verbose_name_plural = _('Post Answers') |
53 | - app_label = 'forum' | |
54 | 52 | |
55 | 53 | def __str__(self): |
56 | 54 | return ''.join([self.user.name, " / ", self.answer_date]) |
57 | 55 | \ No newline at end of file | ... | ... |