-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into api/post-patch-user
- Loading branch information
Showing
50 changed files
with
1,147 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django import forms | ||
from machina.apps.forum.models import Forum | ||
|
||
|
||
class ForumForm(forms.ModelForm): | ||
def __init__(self, *args, **kwargs): | ||
kwargs.setdefault("label_suffix", "") | ||
super().__init__(*args, **kwargs) | ||
|
||
class Meta: | ||
model = Forum | ||
fields = ["name", "description", "image", "type"] | ||
labels = {"image": "Upload forum image"} | ||
widgets = { | ||
"description": forms.Textarea(attrs={"rows": 4}), | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
77
src/chigame/forums/forum_conversation/migrations/0001_initial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
src/chigame/forums/forum_conversation/migrations/0002_post_anonymous_key.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
), | ||
] |
22 changes: 22 additions & 0 deletions
22
src/chigame/forums/forum_conversation/migrations/0003_auto_20160228_2051.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
), | ||
] |
21 changes: 21 additions & 0 deletions
21
src/chigame/forums/forum_conversation/migrations/0004_auto_20160427_0502.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
src/chigame/forums/forum_conversation/migrations/0005_auto_20160607_0455.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
src/chigame/forums/forum_conversation/migrations/0006_post_enable_signature.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
), | ||
] |
26 changes: 26 additions & 0 deletions
26
src/chigame/forums/forum_conversation/migrations/0007_auto_20160903_0450.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
), | ||
] |
Oops, something went wrong.