feat: add announcements
This commit is contained in:
41
src/fellchensammlung/migrations/0005_announcement.py
Normal file
41
src/fellchensammlung/migrations/0005_announcement.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-05 04:21
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("fellchensammlung", "0004_alter_report_reported_broken_rules"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Announcement",
|
||||
fields=[
|
||||
(
|
||||
"text_ptr",
|
||||
models.OneToOneField(
|
||||
auto_created=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
parent_link=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
to="fellchensammlung.text",
|
||||
),
|
||||
),
|
||||
("logged_in_only", models.BooleanField(default=False)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
(
|
||||
"publish_start_time",
|
||||
models.DateTimeField(verbose_name="Veröffentlichungszeitpunk"),
|
||||
),
|
||||
(
|
||||
"publish_end_time",
|
||||
models.DateTimeField(verbose_name="Veröffentlichungsende"),
|
||||
),
|
||||
],
|
||||
bases=("fellchensammlung.text",),
|
||||
),
|
||||
]
|
26
src/fellchensammlung/migrations/0006_announcement_type.py
Normal file
26
src/fellchensammlung/migrations/0006_announcement_type.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 5.0.6 on 2024-06-05 06:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("fellchensammlung", "0005_announcement"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="announcement",
|
||||
name="type",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("important", "important"),
|
||||
("warning", "warning"),
|
||||
("info", "info"),
|
||||
],
|
||||
default="info",
|
||||
max_length=100,
|
||||
),
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user