bornhack-website/src/facilities/migrations/0001_initial.py

217 lines
8.0 KiB
Python

# Generated by Django 3.0.3 on 2020-02-19 19:18
import uuid
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("teams", "0052_team_permission_set"),
]
operations = [
migrations.CreateModel(
name="Facility",
fields=[
(
"uuid",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
(
"name",
models.CharField(
help_text="Name or description of this facility", max_length=100
),
),
(
"description",
models.TextField(help_text="Description of this facility"),
),
],
options={"abstract": False,},
),
migrations.CreateModel(
name="FacilityQuickFeedback",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("feedback", models.CharField(max_length=100)),
(
"icon",
models.CharField(
blank=True,
default="fas fa-exclamation",
help_text="Name of the fontawesome icon to use, including the 'fab fa-' or 'fas fa-' part. Defaults to an exclamation mark icon.",
max_length=100,
),
),
],
),
migrations.CreateModel(
name="FacilityType",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
(
"name",
models.CharField(
help_text="The name of this facility type", max_length=100
),
),
(
"slug",
models.SlugField(
blank=True,
help_text="The url slug for this facility type. Leave blank to autogenerate one.",
),
),
(
"description",
models.TextField(help_text="Description of this facility type"),
),
(
"icon",
models.CharField(
blank=True,
default="fas fa-list",
help_text="Name of the fontawesome icon to use, including the 'fab fa-' or 'fas fa-' part.",
max_length=100,
),
),
(
"quickfeedback_options",
models.ManyToManyField(
help_text="Pick the quick feedback options the user should be presented with when submitting Feedback for a Facility of this type. Pick at least the 'N/A' option if none of the other applies.",
to="facilities.FacilityQuickFeedback",
),
),
(
"responsible_team",
models.ForeignKey(
help_text="The Team responsible for this type of facility. This team will get the notification when we get a new FacilityFeedback for a Facility of this type.",
on_delete=django.db.models.deletion.PROTECT,
to="teams.Team",
),
),
],
options={"unique_together": {("slug", "responsible_team")},},
),
migrations.CreateModel(
name="FacilityFeedback",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
(
"comment",
models.TextField(
blank=True,
help_text="Any comments or feedback about this facility? (optional)",
),
),
(
"urgent",
models.BooleanField(
default=False,
help_text="Check if this is an urgent issue. Will trigger immediate notifications to the responsible team.",
),
),
(
"handled",
models.BooleanField(
default=False,
help_text="True if this feedback has been handled by the responsible team, False if not",
),
),
(
"facility",
models.ForeignKey(
help_text="The Facility this feeback is about",
on_delete=django.db.models.deletion.PROTECT,
related_name="feedbacks",
to="facilities.Facility",
),
),
(
"handled_by",
models.ForeignKey(
blank=True,
help_text="The User who handled this feedback",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="facility_feebacks_handled",
to=settings.AUTH_USER_MODEL,
),
),
(
"quick_feedback",
models.ForeignKey(
help_text="Quick feedback options. Elaborate in comment field as needed.",
on_delete=django.db.models.deletion.PROTECT,
related_name="feedbacks",
to="facilities.FacilityQuickFeedback",
),
),
(
"user",
models.ForeignKey(
blank=True,
help_text="The User this feedback came from, empty if the user submits anonymously",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="facility_feebacks",
to=settings.AUTH_USER_MODEL,
),
),
],
options={"abstract": False,},
),
migrations.AddField(
model_name="facility",
name="facility_type",
field=models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="facilities",
to="facilities.FacilityType",
),
),
]