2016-08-10 11:52:57 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2019-10-05 22:32:54 +00:00
|
|
|
import django.db.models.deletion
|
2024-06-24 11:07:36 +00:00
|
|
|
from django.db import migrations, models
|
2016-08-10 11:52:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
2018-10-04 19:29:19 +00:00
|
|
|
dependencies = [("subscription", "0001_initial"), ("counter", "0001_initial")]
|
2016-08-10 11:52:57 +00:00
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="Launderette",
|
2016-08-10 11:52:57 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=30, verbose_name="name")),
|
|
|
|
(
|
|
|
|
"counter",
|
|
|
|
models.OneToOneField(
|
2019-10-05 22:38:25 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
related_name="launderette",
|
|
|
|
verbose_name="counter",
|
|
|
|
to="counter.Counter",
|
|
|
|
),
|
|
|
|
),
|
2016-08-10 11:52:57 +00:00
|
|
|
],
|
2018-10-04 19:29:19 +00:00
|
|
|
options={"verbose_name": "Launderette"},
|
2016-08-10 11:52:57 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="Machine",
|
2016-08-10 11:52:57 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=30, verbose_name="name")),
|
|
|
|
(
|
|
|
|
"type",
|
|
|
|
models.CharField(
|
|
|
|
choices=[("WASHING", "Washing"), ("DRYING", "Drying")],
|
|
|
|
max_length=10,
|
|
|
|
verbose_name="type",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"is_working",
|
|
|
|
models.BooleanField(verbose_name="is working", default=True),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"launderette",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
verbose_name="launderette",
|
|
|
|
to="launderette.Launderette",
|
|
|
|
related_name="machines",
|
|
|
|
),
|
|
|
|
),
|
2016-08-10 11:52:57 +00:00
|
|
|
],
|
2018-10-04 19:29:19 +00:00
|
|
|
options={"verbose_name": "Machine"},
|
2016-08-10 11:52:57 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="Slot",
|
2016-08-10 11:52:57 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("start_date", models.DateTimeField(verbose_name="start date")),
|
|
|
|
(
|
|
|
|
"type",
|
|
|
|
models.CharField(
|
|
|
|
choices=[("WASHING", "Washing"), ("DRYING", "Drying")],
|
|
|
|
max_length=10,
|
|
|
|
verbose_name="type",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"machine",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
verbose_name="machine",
|
|
|
|
to="launderette.Machine",
|
|
|
|
related_name="slots",
|
|
|
|
),
|
|
|
|
),
|
2016-08-10 11:52:57 +00:00
|
|
|
],
|
2018-10-04 19:29:19 +00:00
|
|
|
options={"verbose_name": "Slot", "ordering": ["start_date"]},
|
2016-08-10 11:52:57 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="Token",
|
2016-08-10 11:52:57 +00:00
|
|
|
fields=[
|
2018-10-04 19:29:19 +00:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
auto_created=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=5, verbose_name="name")),
|
|
|
|
(
|
|
|
|
"type",
|
|
|
|
models.CharField(
|
|
|
|
choices=[("WASHING", "Washing"), ("DRYING", "Drying")],
|
|
|
|
max_length=10,
|
|
|
|
verbose_name="type",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"borrow_date",
|
|
|
|
models.DateTimeField(
|
|
|
|
null=True, verbose_name="borrow date", blank=True
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"launderette",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
verbose_name="launderette",
|
|
|
|
to="launderette.Launderette",
|
|
|
|
related_name="tokens",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
null=True,
|
|
|
|
related_name="tokens",
|
|
|
|
verbose_name="user",
|
|
|
|
to="core.User",
|
|
|
|
blank=True,
|
|
|
|
),
|
|
|
|
),
|
2016-08-10 11:52:57 +00:00
|
|
|
],
|
2018-10-04 19:29:19 +00:00
|
|
|
options={"verbose_name": "Token", "ordering": ["type", "name"]},
|
2016-08-10 11:52:57 +00:00
|
|
|
),
|
2016-08-24 20:09:23 +00:00
|
|
|
migrations.AddField(
|
2018-10-04 19:29:19 +00:00
|
|
|
model_name="slot",
|
|
|
|
name="token",
|
|
|
|
field=models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2018-10-04 19:29:19 +00:00
|
|
|
null=True,
|
|
|
|
related_name="slots",
|
|
|
|
verbose_name="token",
|
|
|
|
to="launderette.Token",
|
|
|
|
blank=True,
|
|
|
|
),
|
2016-08-24 20:09:23 +00:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
2018-10-04 19:29:19 +00:00
|
|
|
model_name="slot",
|
|
|
|
name="user",
|
|
|
|
field=models.ForeignKey(
|
2019-10-05 22:32:54 +00:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
verbose_name="user",
|
|
|
|
to="core.User",
|
|
|
|
related_name="slots",
|
2018-10-04 19:29:19 +00:00
|
|
|
),
|
2016-08-24 20:09:23 +00:00
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
2018-10-04 19:29:19 +00:00
|
|
|
name="token", unique_together=set([("name", "launderette", "type")])
|
2016-08-24 20:09:23 +00:00
|
|
|
),
|
2016-08-10 11:52:57 +00:00
|
|
|
]
|