add tag for announcement
This commit is contained in:
28
account/migrations/0013_alter_user_session_keys_and_more.py
Normal file
28
account/migrations/0013_alter_user_session_keys_and_more.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-13 06:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('account', '0012_userprofile_language'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='session_keys',
|
||||
field=models.JSONField(default=list),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='userprofile',
|
||||
name='acm_problems_status',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='userprofile',
|
||||
name='oi_problems_status',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
]
|
||||
19
announcement/migrations/0004_announcement_tag.py
Normal file
19
announcement/migrations/0004_announcement_tag.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-13 06:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('announcement', '0003_auto_20180501_0436'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='announcement',
|
||||
name='tag',
|
||||
field=models.TextField(default=''),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@@ -8,6 +8,7 @@ class Announcement(models.Model):
|
||||
title = models.TextField()
|
||||
# HTML
|
||||
content = RichTextField()
|
||||
tag = models.TextField()
|
||||
create_time = models.DateTimeField(auto_now_add=True)
|
||||
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
last_update_time = models.DateTimeField(auto_now=True)
|
||||
|
||||
@@ -6,6 +6,7 @@ from .models import Announcement
|
||||
|
||||
class CreateAnnouncementSerializer(serializers.Serializer):
|
||||
title = serializers.CharField(max_length=64)
|
||||
tag = serializers.CharField()
|
||||
content = serializers.CharField(max_length=1024 * 1024 * 8)
|
||||
visible = serializers.BooleanField()
|
||||
|
||||
@@ -29,5 +30,6 @@ class AnnouncementListSerializer(serializers.ModelSerializer):
|
||||
class EditAnnouncementSerializer(serializers.Serializer):
|
||||
id = serializers.IntegerField()
|
||||
title = serializers.CharField(max_length=64)
|
||||
tag = serializers.CharField()
|
||||
content = serializers.CharField(max_length=1024 * 1024 * 8)
|
||||
visible = serializers.BooleanField()
|
||||
|
||||
@@ -16,6 +16,7 @@ class AnnouncementAdminAPI(APIView):
|
||||
data = request.data
|
||||
announcement = Announcement.objects.create(title=data["title"],
|
||||
content=data["content"],
|
||||
tag=data["tag"],
|
||||
created_by=request.user,
|
||||
visible=data["visible"])
|
||||
return self.success(AnnouncementSerializer(announcement).data)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-13 06:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contest', '0010_auto_20190326_0201'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='acmcontestrank',
|
||||
name='submission_info',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='contest',
|
||||
name='allowed_ip_ranges',
|
||||
field=models.JSONField(default=list),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='oicontestrank',
|
||||
name='submission_info',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
]
|
||||
18
options/migrations/0004_alter_sysoptions_value.py
Normal file
18
options/migrations/0004_alter_sysoptions_value.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-13 06:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('options', '0003_migrate_languages_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='sysoptions',
|
||||
name='value',
|
||||
field=models.JSONField(),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,44 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-13 06:09
|
||||
|
||||
import problem.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('problem', '0014_problem_share_submission'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='io_mode',
|
||||
field=models.JSONField(default=problem.models._default_io_mode),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='languages',
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='samples',
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='statistic_info',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='template',
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='test_case_score',
|
||||
field=models.JSONField(),
|
||||
),
|
||||
]
|
||||
23
submission/migrations/0013_alter_submission_info_and_more.py
Normal file
23
submission/migrations/0013_alter_submission_info_and_more.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-13 06:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('submission', '0012_auto_20180501_0436'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='submission',
|
||||
name='info',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='submission',
|
||||
name='statistic_info',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user