Sith/trombi/migrations/0001_initial.py

167 lines
5.6 KiB
Python
Raw Permalink Normal View History

2017-05-10 20:17:05 +00:00
from __future__ import unicode_literals
2017-05-11 14:16:19 +00:00
import datetime
2024-06-24 11:07:36 +00:00
2017-05-11 14:16:19 +00:00
import django.db.models.deletion
2024-06-24 11:07:36 +00:00
from django.conf import settings
from django.db import migrations, models
2017-05-10 20:17:05 +00:00
class Migration(migrations.Migration):
dependencies = [
2018-10-04 19:29:19 +00:00
("club", "0007_auto_20170324_0917"),
2017-05-11 14:16:19 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
2017-05-10 20:17:05 +00:00
]
operations = [
migrations.CreateModel(
2018-10-04 19:29:19 +00:00
name="Trombi",
2017-05-10 20:17:05 +00:00
fields=[
2018-10-04 19:29:19 +00:00
(
"id",
models.AutoField(
serialize=False,
auto_created=True,
verbose_name="ID",
primary_key=True,
),
),
(
"subscription_deadline",
models.DateField(
default=datetime.date.today,
help_text=(
"Before this date, users are allowed "
"to subscribe to this Trombi. "
"After this date, users subscribed will "
"be allowed to comment on each other."
),
2018-10-04 19:29:19 +00:00
verbose_name="subscription deadline",
),
),
(
"comments_deadline",
models.DateField(
default=datetime.date.today,
help_text=(
"After this date, users won't be able "
"to make comments anymore."
),
2018-10-04 19:29:19 +00:00
verbose_name="comments deadline",
),
),
(
"max_chars",
models.IntegerField(
default=400,
help_text="Maximum number of characters allowed in a comment.",
verbose_name="maximum characters",
),
),
(
"club",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
to="club.Club",
related_name="trombi",
),
),
2017-05-10 20:17:05 +00:00
],
),
migrations.CreateModel(
2018-10-04 19:29:19 +00:00
name="TrombiComment",
2017-05-10 20:17:05 +00:00
fields=[
2018-10-04 19:29:19 +00:00
(
"id",
models.AutoField(
serialize=False,
auto_created=True,
verbose_name="ID",
primary_key=True,
),
),
("content", models.TextField(default="", verbose_name="content")),
2017-05-10 20:17:05 +00:00
],
),
migrations.CreateModel(
2018-10-04 19:29:19 +00:00
name="TrombiUser",
2017-05-10 20:17:05 +00:00
fields=[
2018-10-04 19:29:19 +00:00
(
"id",
models.AutoField(
serialize=False,
auto_created=True,
verbose_name="ID",
primary_key=True,
),
),
(
"profile_pict",
models.ImageField(
upload_to="trombi",
blank=True,
help_text=(
"The profile picture you want in the trombi "
"(warning: this picture may be published)"
),
2018-10-04 19:29:19 +00:00
verbose_name="profile pict",
null=True,
),
),
(
"scrub_pict",
models.ImageField(
upload_to="trombi",
blank=True,
help_text=(
"The scrub picture you want in the trombi "
"(warning: this picture may be published)"
),
2018-10-04 19:29:19 +00:00
verbose_name="scrub pict",
null=True,
),
),
(
"trombi",
models.ForeignKey(
to="trombi.Trombi",
blank=True,
verbose_name="trombi",
related_name="users",
on_delete=django.db.models.deletion.SET_NULL,
null=True,
),
),
(
"user",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
2018-10-04 19:29:19 +00:00
verbose_name="trombi user",
to=settings.AUTH_USER_MODEL,
related_name="trombi_user",
),
),
2017-05-10 20:17:05 +00:00
],
),
migrations.AddField(
2018-10-04 19:29:19 +00:00
model_name="trombicomment",
name="author",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2018-10-04 19:29:19 +00:00
to="trombi.TrombiUser",
verbose_name="author",
related_name="given_comments",
),
2017-05-10 20:17:05 +00:00
),
migrations.AddField(
2018-10-04 19:29:19 +00:00
model_name="trombicomment",
name="target",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2018-10-04 19:29:19 +00:00
to="trombi.TrombiUser",
verbose_name="target",
related_name="received_comments",
),
2017-05-10 20:17:05 +00:00
),
]