NDOJ/judge/migrations/0137_auto_20221116_2201.py

85 lines
2.6 KiB
Python
Raw Normal View History

2022-11-16 15:43:03 +00:00
# Generated by Django 3.2.16 on 2022-11-16 15:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
2022-11-17 00:48:32 +00:00
("judge", "0136_alter_profile_timezone"),
2022-11-16 15:43:03 +00:00
]
operations = [
migrations.CreateModel(
2022-11-17 00:48:32 +00:00
name="PageVote",
2022-11-16 15:43:03 +00:00
fields=[
2022-11-17 00:48:32 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"page",
models.CharField(
db_index=True, max_length=30, verbose_name="associated page"
),
),
("score", models.IntegerField(default=0, verbose_name="votes")),
2022-11-16 15:43:03 +00:00
],
options={
2022-11-17 00:48:32 +00:00
"verbose_name": "pagevote",
"verbose_name_plural": "pagevotes",
2022-11-16 15:43:03 +00:00
},
),
migrations.AlterField(
2022-11-17 00:48:32 +00:00
model_name="problemtranslation",
name="language",
field=models.CharField(
choices=[("vi", "Vietnamese"), ("en", "English")],
max_length=7,
verbose_name="language",
),
2022-11-16 15:43:03 +00:00
),
migrations.CreateModel(
2022-11-17 00:48:32 +00:00
name="PageVoteVoter",
2022-11-16 15:43:03 +00:00
fields=[
2022-11-17 00:48:32 +00:00
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("score", models.IntegerField()),
(
"pagevote",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="votes",
to="judge.pagevote",
),
),
(
"voter",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="voted_page",
to="judge.profile",
),
),
2022-11-16 15:43:03 +00:00
],
options={
2022-11-17 00:48:32 +00:00
"verbose_name": "pagevote vote",
"verbose_name_plural": "pagevote votes",
"unique_together": {("voter", "pagevote")},
2022-11-16 15:43:03 +00:00
},
),
]