feat: Add language to rules to make them translatable (migrations)

This commit is contained in:
moanos [he/him] 2024-04-14 15:59:15 +02:00
parent 79a6f672c5
commit d1108aaf60
6 changed files with 64 additions and 160 deletions

View File

@ -1,4 +1,4 @@
# Generated by Django 5.0.3 on 2024-04-14 09:08 # Generated by Django 5.0.3 on 2024-04-14 13:57
import datetime import datetime
import django.contrib.auth.models import django.contrib.auth.models
@ -103,22 +103,6 @@ class Migration(migrations.Migration):
), ),
], ],
), ),
migrations.CreateModel(
name="Rule",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=200)),
("rule_text", models.TextField()),
],
),
migrations.CreateModel( migrations.CreateModel(
name="Species", name="Species",
fields=[ fields=[
@ -314,38 +298,6 @@ class Migration(migrations.Migration):
], ],
}, },
), ),
migrations.CreateModel(
name="MarkdownContent",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=100)),
("content", models.TextField()),
(
"text_code",
models.CharField(
blank=True, max_length=24, verbose_name="text_code"
),
),
(
"language",
models.OneToOneField(
on_delete=django.db.models.deletion.PROTECT,
to="fellchensammlung.language",
),
),
],
options={
"verbose_name_plural": "Markdown content",
},
),
migrations.CreateModel( migrations.CreateModel(
name="Member", name="Member",
fields=[ fields=[
@ -428,10 +380,6 @@ class Migration(migrations.Migration):
to="fellchensammlung.adoptionnotice", to="fellchensammlung.adoptionnotice",
), ),
), ),
(
"reported_broken_rules",
models.ManyToManyField(blank=True, to="fellchensammlung.rule"),
),
], ],
options={ options={
"permissions": [], "permissions": [],
@ -533,6 +481,35 @@ class Migration(migrations.Migration):
verbose_name="Organisation", verbose_name="Organisation",
), ),
), ),
migrations.CreateModel(
name="Rule",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=200)),
("rule_text", models.TextField()),
("rule_identifier", models.CharField(max_length=24)),
(
"language",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to="fellchensammlung.language",
),
),
],
),
migrations.AddField(
model_name="report",
name="reported_broken_rules",
field=models.ManyToManyField(blank=True, to="fellchensammlung.rule"),
),
migrations.CreateModel( migrations.CreateModel(
name="Animal", name="Animal",
fields=[ fields=[
@ -585,4 +562,38 @@ class Migration(migrations.Migration):
), ),
], ],
), ),
migrations.CreateModel(
name="Text",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("title", models.CharField(max_length=100)),
("content", models.TextField(verbose_name="Inhalt")),
(
"text_code",
models.CharField(
blank=True, max_length=24, verbose_name="Text code"
),
),
(
"language",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to="fellchensammlung.language",
verbose_name="Sprache",
),
),
],
options={
"verbose_name": "Text",
"verbose_name_plural": "Texte",
},
),
] ]

View File

@ -1,17 +0,0 @@
# Generated by Django 5.0.3 on 2024-04-14 11:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("fellchensammlung", "0001_initial"),
]
operations = [
migrations.RenameModel(
old_name="MarkdownContent",
new_name="Text",
),
]

View File

@ -1,17 +0,0 @@
# Generated by Django 5.0.3 on 2024-04-14 11:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("fellchensammlung", "0002_rename_markdowncontent_text"),
]
operations = [
migrations.AlterModelOptions(
name="text",
options={"verbose_name_plural": "Text"},
),
]

View File

@ -1,17 +0,0 @@
# Generated by Django 5.0.3 on 2024-04-14 11:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("fellchensammlung", "0003_alter_text_options"),
]
operations = [
migrations.AlterModelOptions(
name="text",
options={"verbose_name": "Text", "verbose_name_plural": "Texte"},
),
]

View File

@ -1,33 +0,0 @@
# Generated by Django 5.0.3 on 2024-04-14 12:06
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("fellchensammlung", "0004_alter_text_options"),
]
operations = [
migrations.AlterField(
model_name="text",
name="content",
field=models.TextField(verbose_name="Inhalt"),
),
migrations.AlterField(
model_name="text",
name="language",
field=models.OneToOneField(
on_delete=django.db.models.deletion.PROTECT,
to="fellchensammlung.language",
verbose_name="Sprache",
),
),
migrations.AlterField(
model_name="text",
name="text_code",
field=models.CharField(blank=True, max_length=24, verbose_name="Text code"),
),
]

View File

@ -1,23 +0,0 @@
# Generated by Django 5.0.3 on 2024-04-14 12:12
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("fellchensammlung", "0005_alter_text_content_alter_text_language_and_more"),
]
operations = [
migrations.AlterField(
model_name="text",
name="language",
field=models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to="fellchensammlung.language",
verbose_name="Sprache",
),
),
]