1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-30 04:13:01 +00:00
nk20/apps/wei/migrations/0001_initial.py

121 lines
6.8 KiB
Python
Raw Normal View History

# Generated by Django 2.2.16 on 2020-09-04 21:41
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
class Migration(migrations.Migration):
initial = True
dependencies = [
('permission', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('member', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Bus',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, verbose_name='name')),
('description', models.TextField(blank=True, default='', verbose_name='description')),
('information_json', models.TextField(default='{}', help_text='Information about the survey for new members, encoded in JSON', verbose_name='survey information')),
],
options={
'verbose_name': 'Bus',
'verbose_name_plural': 'Buses',
},
),
migrations.CreateModel(
name='BusTeam',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, verbose_name='name')),
('color', models.PositiveIntegerField(help_text='The color of the T-Shirt, stored with its number equivalent', verbose_name='color')),
('description', models.TextField(blank=True, default='', verbose_name='description')),
('bus', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teams', to='wei.Bus', verbose_name='bus')),
],
options={
'verbose_name': 'Bus team',
'verbose_name_plural': 'Bus teams',
'unique_together': {('bus', 'name')},
},
),
migrations.CreateModel(
name='WEIClub',
fields=[
('club_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.Club')),
('year', models.PositiveIntegerField(default=2020, unique=True, verbose_name='year')),
('date_start', models.DateField(verbose_name='date start')),
('date_end', models.DateField(verbose_name='date end')),
],
options={
'verbose_name': 'WEI',
'verbose_name_plural': 'WEI',
},
bases=('member.club',),
),
migrations.CreateModel(
name='WEIRole',
fields=[
('role_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='permission.Role')),
],
options={
'verbose_name': 'WEI Role',
'verbose_name_plural': 'WEI Roles',
},
bases=('permission.role',),
),
migrations.CreateModel(
name='WEIRegistration',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('soge_credit', models.BooleanField(default=False, verbose_name='Credit from Société générale')),
('caution_check', models.BooleanField(default=False, verbose_name='Caution check given')),
('birth_date', models.DateField(verbose_name='birth date')),
('gender', models.CharField(choices=[('male', 'Male'), ('female', 'Female'), ('nonbinary', 'Non binary')], max_length=16, verbose_name='gender')),
('clothing_cut', models.CharField(choices=[('male', 'Male'), ('female', 'Female')], max_length=16, verbose_name='clothing cut')),
('clothing_size', models.CharField(choices=[('XS', 'XS'), ('S', 'S'), ('M', 'M'), ('L', 'L'), ('XL', 'XL'), ('XXL', 'XXL')], max_length=4, verbose_name='clothing size')),
('health_issues', models.TextField(blank=True, default='', verbose_name='health issues')),
('emergency_contact_name', models.CharField(max_length=255, verbose_name='emergency contact name')),
('emergency_contact_phone', phonenumber_field.modelfields.PhoneNumberField(max_length=32, region=None, verbose_name='emergency contact phone')),
('first_year', models.BooleanField(default=False, help_text='Tells if the user is new in the school.', verbose_name='first year')),
('information_json', models.TextField(default='{}', help_text='Information about the registration (buses for old members, survey fot the new members), encoded in JSON', verbose_name='registration information')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='wei', to=settings.AUTH_USER_MODEL, verbose_name='user')),
('wei', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='users', to='wei.WEIClub', verbose_name='WEI')),
],
options={
'verbose_name': 'WEI User',
'verbose_name_plural': 'WEI Users',
'unique_together': {('user', 'wei')},
},
),
migrations.CreateModel(
name='WEIMembership',
fields=[
('membership_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.Membership')),
('bus', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to='wei.Bus', verbose_name='bus')),
('registration', models.OneToOneField(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='membership', to='wei.WEIRegistration', verbose_name='WEI registration')),
('team', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='memberships', to='wei.BusTeam', verbose_name='team')),
],
options={
'verbose_name': 'WEI membership',
'verbose_name_plural': 'WEI memberships',
},
bases=('member.membership',),
),
migrations.AddField(
model_name='bus',
name='wei',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='buses', to='wei.WEIClub', verbose_name='WEI'),
),
migrations.AlterUniqueTogether(
name='bus',
unique_together={('wei', 'name')},
),
]