Commit 82efaefd69c4e9e4ff90d7a1763aa95c7ea158f9

Authored by Zambom
1 parent 0b412aee

Forum's model [Issue: #81]

forum/__init__.py 0 → 100644
forum/admin.py 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +from django.contrib import admin
  2 +
  3 +# Register your models here.
... ...
forum/apps.py 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +from django.apps import AppConfig
  2 +
  3 +
  4 +class ForumConfig(AppConfig):
  5 + name = 'forum'
... ...
forum/migrations/__init__.py 0 → 100644
forum/models.py 0 → 100644
... ... @@ -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
... ...
forum/tests.py 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +from django.test import TestCase
  2 +
  3 +# Create your tests here.
... ...
forum/views.py 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +from django.shortcuts import render
  2 +
  3 +# Create your views here.
... ...