-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from sparcs-kaist/feature/integrate-talk
- Loading branch information
Showing
19 changed files
with
320 additions
and
173 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.16 on 2023-05-09 13:57 | ||
|
||
import apps.core.models.board | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0046_update_hidden_at_min_time_to_null"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="board", | ||
name="name_type", | ||
field=models.SmallIntegerField( | ||
db_index=True, | ||
default=apps.core.models.board.NameType["REGULAR"], | ||
help_text="글과 댓글을 어떤 이름 설정(닉네임/익명/실명)으로 작성할 수 있는지 정의합니다.", | ||
verbose_name="닉네임/익명/실명글 허용 여부 설정", | ||
), | ||
), | ||
] |
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,43 @@ | ||
# Generated by retro on 2023-05-09 14:03 | ||
|
||
from django.db import migrations | ||
|
||
from apps.core.models.board import Board, NameType | ||
from apps.core.models.article import Article | ||
from apps.core.models.comment import Comment | ||
from django.db import transaction | ||
|
||
|
||
@transaction.atomic | ||
def update_nametypes(apps, schema_editor): | ||
regular_boards = Board.objects.filter(name_type=0).values() | ||
anonymous_boards = Board.objects.filter(name_type=1).values() | ||
realname_boards = Board.objects.filter(name_type=2).values() | ||
|
||
realname_boards.update(name_type=NameType.REALNAME) | ||
anonymous_boards.update(name_type=NameType.ANONYMOUS) | ||
regular_boards.update(name_type=NameType.REGULAR) | ||
|
||
regular_articles = Article.objects.filter(name_type=0).values() | ||
anonymous_articles = Article.objects.filter(name_type=1).values() | ||
realname_articles = Article.objects.filter(name_type=2).values() | ||
|
||
realname_articles.update(name_type=NameType.REALNAME) | ||
anonymous_articles.update(name_type=NameType.ANONYMOUS) | ||
regular_articles.update(name_type=NameType.REGULAR) | ||
|
||
regular_comments = Comment.objects.filter(name_type=0).values() | ||
anonymous_comments = Comment.objects.filter(name_type=1).values() | ||
realname_comments = Comment.objects.filter(name_type=2).values() | ||
|
||
realname_comments.update(name_type=NameType.REALNAME) | ||
anonymous_comments.update(name_type=NameType.ANONYMOUS) | ||
regular_comments.update(name_type=NameType.REGULAR) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0047_alter_board_name_type"), | ||
] | ||
|
||
operations = [migrations.RunPython(update_nametypes)] |
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
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
Oops, something went wrong.