Skip to content

Commit

Permalink
Merge branch 'dev' into users/hist-info
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewM131 authored Dec 5, 2023
2 parents 3e057fa + 3538607 commit 6371135
Show file tree
Hide file tree
Showing 37 changed files with 823 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class ForumsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "forums"
name = "chigame.forums"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions src/chigame/forums/forum_conversation/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from machina.apps.forum_conversation.apps import ForumConversationAppConfig as BaseForumConversationAppConfig


class ForumConversationConfig(BaseForumConversationAppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "chigame.forum_conversation"
77 changes: 77 additions & 0 deletions src/chigame/forums/forum_conversation/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings
import machina.models.fields


class Migration(migrations.Migration):

dependencies = [
('forum', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')),
('updated', models.DateTimeField(auto_now=True, verbose_name='Update date')),
('poster_ip', models.GenericIPAddressField(default='2002::0', null=True, verbose_name='Poster IP address', blank=True)),
('subject', models.CharField(max_length=255, verbose_name='Subject')),
('content', machina.models.fields.MarkupTextField(no_rendered_field=True, verbose_name='Content')),
('username', models.CharField(max_length=155, null=True, verbose_name='Username', blank=True)),
('approved', models.BooleanField(default=True, verbose_name='Approved')),
('update_reason', models.CharField(max_length=255, null=True, verbose_name='Update reason', blank=True)),
('updates_count', models.PositiveIntegerField(default=0, verbose_name='Updates count', editable=False, blank=True)),
('_content_rendered', models.TextField(null=True, editable=False, blank=True)),
('poster', models.ForeignKey(related_name='posts', verbose_name='Poster', blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
],
options={
'ordering': ['created'],
'abstract': False,
'get_latest_by': 'created',
'verbose_name': 'Post',
'verbose_name_plural': 'Posts',
},
),
migrations.CreateModel(
name='Topic',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')),
('updated', models.DateTimeField(auto_now=True, verbose_name='Update date')),
('subject', models.CharField(max_length=255, verbose_name='Subject')),
('slug', models.SlugField(max_length=255, verbose_name='Slug')),
('type', models.PositiveSmallIntegerField(db_index=True, verbose_name='Topic type', choices=[(0, 'Default topic'), (1, 'Sticky'), (2, 'Announce')])),
('status', models.PositiveIntegerField(db_index=True, verbose_name='Topic status', choices=[(0, 'Topic unlocked'), (1, 'Topic locked'), (2, 'Topic moved')])),
('approved', models.BooleanField(default=True, verbose_name='Approved')),
('posts_count', models.PositiveIntegerField(default=0, verbose_name='Posts count', editable=False, blank=True)),
('views_count', models.PositiveIntegerField(default=0, verbose_name='Views count', editable=False, blank=True)),
('last_post_on', models.DateTimeField(null=True, verbose_name='Last post added on', blank=True)),
('forum', models.ForeignKey(related_name='topics', verbose_name='Topic forum', to='forum.Forum', on_delete=models.CASCADE)),
('poster', models.ForeignKey(verbose_name='Poster', blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
('subscribers', models.ManyToManyField(related_name='subscriptions', verbose_name='Subscribers', to=settings.AUTH_USER_MODEL, blank=True)),
],
options={
'ordering': ['-type', '-last_post_on'],
'abstract': False,
'get_latest_by': 'last_post_on',
'verbose_name': 'Topic',
'verbose_name_plural': 'Topics',
},
),
migrations.AddField(
model_name='post',
name='topic',
field=models.ForeignKey(related_name='posts', verbose_name='Topic', to='forum_conversation.Topic', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='post',
name='updated_by',
field=models.ForeignKey(blank=True, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Lastly updated by', on_delete=models.SET_NULL),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='post',
name='anonymous_key',
field=models.CharField(max_length=100, null=True, verbose_name='Anonymous user forum key', blank=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-28 19:51
from __future__ import unicode_literals

from django.db import migrations
import machina.core.validators
import machina.models.fields


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0002_post_anonymous_key'),
]

operations = [
migrations.AlterField(
model_name='post',
name='content',
field=machina.models.fields.MarkupTextField(no_rendered_field=True, validators=[machina.core.validators.NullableMaxLengthValidator(None)], verbose_name='Content'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-04-27 03:02
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0003_auto_20160228_2051'),
]

operations = [
migrations.AlterField(
model_name='topic',
name='subscribers',
field=models.ManyToManyField(blank=True, related_name='topic_subscriptions', to=settings.AUTH_USER_MODEL, verbose_name='Subscribers'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-07 02:55
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0004_auto_20160427_0502'),
]

operations = [
migrations.AlterField(
model_name='post',
name='approved',
field=models.BooleanField(db_index=True, default=True, verbose_name='Approved'),
),
migrations.AlterField(
model_name='topic',
name='approved',
field=models.BooleanField(db_index=True, default=True, verbose_name='Approved'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-09 04:16
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0005_auto_20160607_0455'),
]

operations = [
migrations.AddField(
model_name='post',
name='enable_signature',
field=models.BooleanField(db_index=True, default=True, verbose_name='Attach a signature'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-03 02:50
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0006_post_enable_signature'),
]

operations = [
migrations.AddField(
model_name='topic',
name='first_post',
field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='forum_conversation.Post', verbose_name='Last post'),
),
migrations.AddField(
model_name='topic',
name='last_post',
field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='forum_conversation.Post', verbose_name='Last post'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-03 03:12
from __future__ import unicode_literals

from django.db import migrations


def update_topic_first_post_last_post(apps, schema_editor):
Topic = apps.get_model('forum_conversation', 'Topic')
for topic in Topic.objects.all():
first_post = topic.posts.all().order_by('created').first()
last_post = topic.posts.filter(approved=True).order_by('-created').first()
topic.first_post = first_post
topic.last_post = last_post
topic.save()

def reverse_topic_first_post_last_post(apps, schema_editor):
pass


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0007_auto_20160903_0450'),
]

operations = [
migrations.RunPython(
update_topic_first_post_last_post, reverse_code=reverse_topic_first_post_last_post),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-25 19:26
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0008_auto_20160903_0512'),
]

operations = [
migrations.AlterField(
model_name='topic',
name='slug',
field=models.SlugField(max_length=255, verbose_name='Slug'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-20 01:24
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0009_auto_20160925_2126'),
]

operations = [
migrations.AlterField(
model_name='topic',
name='first_post',
field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='forum_conversation.Post', verbose_name='First post'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.1.2 on 2018-10-24 02:44

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0010_auto_20170120_0224'),
]

operations = [
migrations.RemoveField(
model_name='post',
name='poster_ip',
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.2.10 on 2020-04-23 15:49

from django.db import migrations
import machina.core.validators
import machina.models.fields


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0011_remove_post_poster_ip'),
]

operations = [
migrations.AlterField(
model_name='post',
name='content',
field=machina.models.fields.MarkupTextField(no_rendered_field=True, validators=[machina.core.validators.MarkupMaxLengthValidator(None)], verbose_name='Content'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 3.1.2 on 2020-12-20 22:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('forum_conversation', '0012_auto_20200423_1049'),
]

operations = [
migrations.AlterField(
model_name='topic',
name='created',
field=models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Creation date'),
),
migrations.AlterField(
model_name='topic',
name='last_post_on',
field=models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Last post added on'),
),
migrations.AlterField(
model_name='topic',
name='updated',
field=models.DateTimeField(auto_now=True, db_index=True, verbose_name='Update date'),
),
migrations.AddIndex(
model_name='topic',
index=models.Index(fields=['type', 'last_post_on'], name='forum_conve_type_cc96d0_idx'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.4 on 2023-11-29 00:14

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("forum_conversation", "0013_auto_20201220_1745"),
]

operations = [
migrations.AlterField(
model_name="post",
name="id",
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"),
),
migrations.AlterField(
model_name="topic",
name="id",
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"),
),
]
Loading

0 comments on commit 6371135

Please sign in to comment.