From 5e039d6bf582d75873ab02f26b2e97a3caa36775 Mon Sep 17 00:00:00 2001 From: "Andreas (@xAndy) Zimmermann" Date: Wed, 27 Apr 2022 16:36:34 +0200 Subject: [PATCH] black --- shiftregister/app/migrations/0001_initial.py | 135 ++++++++++++++---- .../importer/migrations/0001_initial.py | 35 +++-- 2 files changed, 130 insertions(+), 40 deletions(-) diff --git a/shiftregister/app/migrations/0001_initial.py b/shiftregister/app/migrations/0001_initial.py index 1178937..544b9f2 100644 --- a/shiftregister/app/migrations/0001_initial.py +++ b/shiftregister/app/migrations/0001_initial.py @@ -10,63 +10,136 @@ class Migration(migrations.Migration): initial = True - dependencies = [ - ] + dependencies = [] operations = [ migrations.CreateModel( - name='Helper', + name="Helper", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('phone', phonenumber_field.modelfields.PhoneNumberField(editable=False, max_length=128, region=None, unique=True)), - ('name', models.CharField(max_length=200)), - ('number_validated', models.BooleanField(default=False)), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "phone", + phonenumber_field.modelfields.PhoneNumberField( + editable=False, max_length=128, region=None, unique=True + ), + ), + ("name", models.CharField(max_length=200)), + ("number_validated", models.BooleanField(default=False)), ], ), migrations.CreateModel( - name='Room', + name="Room", fields=[ - ('name', models.CharField(max_length=200, primary_key=True, serialize=False)), - ('required_helpers', models.IntegerField()), + ( + "name", + models.CharField(max_length=200, primary_key=True, serialize=False), + ), + ("required_helpers", models.IntegerField()), ], ), migrations.CreateModel( - name='Shift', + name="Shift", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('start_at', models.DateTimeField()), - ('duration', models.DurationField()), - ('deleted', models.BooleanField(default=False)), - ('room', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='app.room')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("start_at", models.DateTimeField()), + ("duration", models.DurationField()), + ("deleted", models.BooleanField(default=False)), + ( + "room", + models.ForeignKey( + on_delete=django.db.models.deletion.RESTRICT, to="app.room" + ), + ), ], ), migrations.CreateModel( - name='Message', + name="Message", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('text', models.CharField(max_length=160)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.helper')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("text", models.CharField(max_length=160)), + ("created_at", models.DateTimeField(auto_now_add=True)), + ( + "to", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="app.helper" + ), + ), ], ), migrations.CreateModel( - name='LoginToken', + name="LoginToken", fields=[ - ('id', models.CharField(default=shiftregister.app.models.gen_token, editable=False, max_length=20, primary_key=True, serialize=False)), - ('sent_at', models.DateTimeField(auto_now_add=True)), - ('helper', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.helper')), + ( + "id", + models.CharField( + default=shiftregister.app.models.gen_token, + editable=False, + max_length=20, + primary_key=True, + serialize=False, + ), + ), + ("sent_at", models.DateTimeField(auto_now_add=True)), + ( + "helper", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="app.helper" + ), + ), ], ), migrations.CreateModel( - name='ShiftRegistration', + name="ShiftRegistration", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('reminder_sent', models.BooleanField(default=False)), - ('helper', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.helper')), - ('shift', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='app.shift')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("reminder_sent", models.BooleanField(default=False)), + ( + "helper", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="app.helper" + ), + ), + ( + "shift", + models.ForeignKey( + on_delete=django.db.models.deletion.RESTRICT, to="app.shift" + ), + ), ], options={ - 'unique_together': {('shift', 'helper')}, + "unique_together": {("shift", "helper")}, }, ), ] diff --git a/shiftregister/importer/migrations/0001_initial.py b/shiftregister/importer/migrations/0001_initial.py index cbe54ad..1d6b6ba 100644 --- a/shiftregister/importer/migrations/0001_initial.py +++ b/shiftregister/importer/migrations/0001_initial.py @@ -9,24 +9,41 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('app', '0001_initial'), + ("app", "0001_initial"), ] operations = [ migrations.CreateModel( - name='Calendar', + name="Calendar", fields=[ - ('url', models.URLField(primary_key=True, serialize=False)), - ('has_errors', models.BooleanField(default=False, editable=False)), + ("url", models.URLField(primary_key=True, serialize=False)), + ("has_errors", models.BooleanField(default=False, editable=False)), ], ), migrations.CreateModel( - name='Event', + name="Event", fields=[ - ('shift_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='app.shift')), - ('uuid', models.UUIDField(editable=False, primary_key=True, serialize=False)), - ('calendar', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='importer.calendar')), + ( + "shift_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + to="app.shift", + ), + ), + ( + "uuid", + models.UUIDField(editable=False, primary_key=True, serialize=False), + ), + ( + "calendar", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="importer.calendar", + ), + ), ], - bases=('app.shift',), + bases=("app.shift",), ), ]