SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 0d298635 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Start work on forums app (stash, draft)

parent 7469c335
No related branches found
No related tags found
No related merge requests found
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class ForumsConfig(AppConfig):
name = 'forums'
__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
from django.db import models
from django.utils import timezone
class Forum(models.Model):
"""
A Forum is a discussion place for a specified set of Users,
with access specified on a per-Group or per-User access.
"""
name = models.CharField(max_length=256)
slug = models.SlugField(allow_unicode=True)
accessible_to_group = models.ManyToManyField('auth.Group',
related_name='group_forums',
blank=True)
accessible_to_users = models.ManyToManyField('auth.User',
related_name='user_forums',
blank=True)
publicly_visible = models.BooleanField(default=False)
class Meeting(Forum):
"""
A Meeting is like a Forum, but with a fixed time span.
"""
date_from = models.DateField()
date_until = models.DateField()
preamble = models.TextField()
minutes = models.TextField(blank=True, null=True)
class Thread(models.Model):
"""
A Thread is a container for Posts.
"""
theme = models.CharField(max_length=256)
slug = models.SlugField()
forum = models.ForeignKey('forums.Forum')
class Post(models.Model):
"""
A comment, feedback, question, ... pertaining to a Thread
"""
posted_by = models.ForeignKey('auth.User')
posted_on = models.DateTimeField(default=timezone.now)
text = models.TextField()
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
......@@ -25,7 +25,8 @@ django-maintenancemode-2==1.1.11
# Documentation Packages
docutils==0.12 # What's this thing?
docutils==0.12 # What's this thing? -> for docs!
django-docutils==0.4.0
Pygments==2.2.0 # Syntax highlighter
Sphinx==1.4.9
sphinx-rtd-theme==0.1.9 # Sphinx theme
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment