2017-01-21 02:42:06 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
2017-01-21 03:51:37 +00:00
|
|
|
import django.utils.timezone
|
2017-01-21 02:42:06 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
('core', '0019_preferences_receive_weekmail'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Forum',
|
|
|
|
fields=[
|
2017-01-21 03:51:37 +00:00
|
|
|
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
|
2017-01-21 02:42:06 +00:00
|
|
|
('name', models.CharField(verbose_name='name', max_length=64)),
|
|
|
|
('description', models.CharField(default='', verbose_name='description', max_length=256)),
|
|
|
|
('is_category', models.BooleanField(default=False, verbose_name='is a category')),
|
2017-01-21 03:51:37 +00:00
|
|
|
('edit_groups', models.ManyToManyField(default=[4], related_name='editable_forums', blank=True, to='core.Group')),
|
|
|
|
('owner_group', models.ForeignKey(default=12, related_name='owned_forums', to='core.Group')),
|
|
|
|
('parent', models.ForeignKey(null=True, related_name='children', blank=True, to='forum.Forum')),
|
|
|
|
('view_groups', models.ManyToManyField(default=[2], related_name='viewable_forums', blank=True, to='core.Group')),
|
2017-01-21 02:42:06 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='ForumMessage',
|
|
|
|
fields=[
|
2017-01-21 03:51:37 +00:00
|
|
|
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
|
|
|
|
('title', models.CharField(default='', verbose_name='title', blank=True, max_length=64)),
|
|
|
|
('message', models.TextField(default='', verbose_name='message')),
|
|
|
|
('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date')),
|
|
|
|
('author', models.ForeignKey(related_name='forum_messages', to=settings.AUTH_USER_MODEL)),
|
2017-01-21 02:42:06 +00:00
|
|
|
],
|
2017-01-21 03:51:37 +00:00
|
|
|
options={
|
|
|
|
'ordering': ['id'],
|
|
|
|
},
|
2017-01-21 02:42:06 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='ForumTopic',
|
|
|
|
fields=[
|
2017-01-21 03:51:37 +00:00
|
|
|
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
|
|
|
|
('title', models.CharField(default='', verbose_name='title', max_length=64)),
|
|
|
|
('description', models.CharField(default='', verbose_name='description', max_length=256)),
|
|
|
|
('author', models.ForeignKey(related_name='forum_topics', to=settings.AUTH_USER_MODEL)),
|
|
|
|
('forum', models.ForeignKey(related_name='topics', to='forum.Forum')),
|
2017-01-21 02:42:06 +00:00
|
|
|
],
|
2017-01-21 03:51:37 +00:00
|
|
|
options={
|
|
|
|
'ordering': ['-id'],
|
|
|
|
},
|
2017-01-21 02:42:06 +00:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='forummessage',
|
|
|
|
name='topic',
|
2017-01-21 03:51:37 +00:00
|
|
|
field=models.ForeignKey(related_name='messages', to='forum.ForumTopic'),
|
2017-01-21 02:42:06 +00:00
|
|
|
),
|
|
|
|
]
|