Commit 82efaefd69c4e9e4ff90d7a1763aa95c7ea158f9
1 parent
0b412aee
Exists in
master
and in
5 other branches
Forum's model [Issue: #81]
Showing
7 changed files
with
36 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +from django.utils.translation import ugettext_lazy as _ | |
| 2 | +from django.db import models | |
| 3 | + | |
| 4 | +from autoslug.fields import AutoSlugField | |
| 5 | + | |
| 6 | +from courses.models import Activity | |
| 7 | + | |
| 8 | +""" | |
| 9 | +It's one kind of activity available for a Topic. | |
| 10 | +It works like a 'topic' of forum, which users can post to it and answer posts of it. | |
| 11 | +""" | |
| 12 | +class Forum(Activity): | |
| 13 | + title = models.CharField(_('Title'), max_length = 100) | |
| 14 | + description = models.TextField(_('Description'), blank = True) | |
| 15 | + create_date = models.DateField(_('Create Date'), auto_now_add = True) | |
| 16 | + | |
| 17 | + class Meta: | |
| 18 | + verbose_name = _('Forum') | |
| 19 | + verbose_name_plural = _('Foruns') | |
| 20 | + | |
| 21 | + def __str__(self): | |
| 22 | + return self.title | ... | ... |