comparison forums/migrations/0001_initial.py @ 1028:5ba2508939f7

Django 1.8 changes; first batch.
author Brian Neal <bgneal@gmail.com>
date Tue, 15 Dec 2015 21:01:07 -0600
parents
children
comparison
equal deleted inserted replaced
1027:cd4db27c90e3 1028:5ba2508939f7
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import migrations, models
5 from django.conf import settings
6
7
8 class Migration(migrations.Migration):
9
10 dependencies = [
11 ('oembed', '__first__'),
12 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
13 ('auth', '0006_require_contenttypes_0002'),
14 ]
15
16 operations = [
17 migrations.CreateModel(
18 name='Attachment',
19 fields=[
20 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
21 ('order', models.IntegerField()),
22 ('embed', models.ForeignKey(to='oembed.Oembed')),
23 ],
24 options={
25 'ordering': ('order',),
26 },
27 ),
28 migrations.CreateModel(
29 name='Category',
30 fields=[
31 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
32 ('name', models.CharField(max_length=80)),
33 ('slug', models.SlugField(max_length=80)),
34 ('position', models.IntegerField(default=0, blank=True)),
35 ('groups', models.ManyToManyField(help_text=b'If groups are assigned to this category, only members of those groups can view this category.', to='auth.Group', null=True, blank=True)),
36 ],
37 options={
38 'ordering': ('position',),
39 'verbose_name_plural': 'Categories',
40 },
41 ),
42 migrations.CreateModel(
43 name='FlaggedPost',
44 fields=[
45 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
46 ('flag_date', models.DateTimeField(auto_now_add=True)),
47 ],
48 options={
49 'ordering': ('flag_date',),
50 },
51 ),
52 migrations.CreateModel(
53 name='Forum',
54 fields=[
55 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
56 ('name', models.CharField(max_length=80)),
57 ('slug', models.SlugField(max_length=80)),
58 ('description', models.TextField(default=b'', blank=True)),
59 ('position', models.IntegerField(default=0, blank=True)),
60 ('topic_count', models.IntegerField(default=0, blank=True)),
61 ('post_count', models.IntegerField(default=0, blank=True)),
62 ('category', models.ForeignKey(related_name='forums', to='forums.Category')),
63 ],
64 options={
65 'ordering': ('position',),
66 },
67 ),
68 migrations.CreateModel(
69 name='ForumLastVisit',
70 fields=[
71 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
72 ('begin_date', models.DateTimeField()),
73 ('end_date', models.DateTimeField()),
74 ('forum', models.ForeignKey(to='forums.Forum')),
75 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
76 ],
77 options={
78 'ordering': ('-end_date',),
79 },
80 ),
81 migrations.CreateModel(
82 name='Post',
83 fields=[
84 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
85 ('creation_date', models.DateTimeField(db_index=True)),
86 ('update_date', models.DateTimeField(db_index=True)),
87 ('body', models.TextField()),
88 ('html', models.TextField()),
89 ('user_ip', models.IPAddressField(default=b'', null=True, blank=True)),
90 ('attachments', models.ManyToManyField(to='oembed.Oembed', through='forums.Attachment')),
91 ],
92 options={
93 'ordering': ('creation_date',),
94 'get_latest_by': 'creation_date',
95 'verbose_name': 'forum post',
96 'verbose_name_plural': 'forum posts',
97 },
98 ),
99 migrations.CreateModel(
100 name='Topic',
101 fields=[
102 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
103 ('name', models.CharField(max_length=255)),
104 ('creation_date', models.DateTimeField(db_index=True)),
105 ('view_count', models.IntegerField(default=0, blank=True)),
106 ('sticky', models.BooleanField(default=False)),
107 ('locked', models.BooleanField(default=False)),
108 ('post_count', models.IntegerField(default=0, blank=True)),
109 ('update_date', models.DateTimeField(db_index=True)),
110 ('bookmarkers', models.ManyToManyField(related_name='favorite_topics', verbose_name=b'bookmarkers', to=settings.AUTH_USER_MODEL, blank=True)),
111 ('forum', models.ForeignKey(related_name='topics', to='forums.Forum')),
112 ('last_post', models.OneToOneField(related_name='parent_topic', null=True, blank=True, to='forums.Post')),
113 ('subscribers', models.ManyToManyField(related_name='subscriptions', verbose_name=b'subscribers', to=settings.AUTH_USER_MODEL, blank=True)),
114 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
115 ],
116 options={
117 'ordering': ('-sticky', '-update_date'),
118 },
119 ),
120 migrations.CreateModel(
121 name='TopicLastVisit',
122 fields=[
123 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
124 ('last_visit', models.DateTimeField(db_index=True)),
125 ('topic', models.ForeignKey(to='forums.Topic')),
126 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
127 ],
128 options={
129 'ordering': ('-last_visit',),
130 },
131 ),
132 migrations.AddField(
133 model_name='post',
134 name='topic',
135 field=models.ForeignKey(related_name='posts', to='forums.Topic'),
136 ),
137 migrations.AddField(
138 model_name='post',
139 name='user',
140 field=models.ForeignKey(related_name='posts', to=settings.AUTH_USER_MODEL),
141 ),
142 migrations.AddField(
143 model_name='forum',
144 name='last_post',
145 field=models.OneToOneField(related_name='parent_forum', null=True, blank=True, to='forums.Post'),
146 ),
147 migrations.AddField(
148 model_name='forum',
149 name='moderators',
150 field=models.ManyToManyField(to='auth.Group', null=True, blank=True),
151 ),
152 migrations.AddField(
153 model_name='flaggedpost',
154 name='post',
155 field=models.ForeignKey(to='forums.Post'),
156 ),
157 migrations.AddField(
158 model_name='flaggedpost',
159 name='user',
160 field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
161 ),
162 migrations.AddField(
163 model_name='attachment',
164 name='post',
165 field=models.ForeignKey(to='forums.Post'),
166 ),
167 migrations.AlterUniqueTogether(
168 name='topiclastvisit',
169 unique_together=set([('user', 'topic')]),
170 ),
171 migrations.AlterUniqueTogether(
172 name='forumlastvisit',
173 unique_together=set([('user', 'forum')]),
174 ),
175 ]