plateforme-tfjm2/apps/member/migrations/0001_initial.py

134 lines
8.4 KiB
Python
Raw Normal View History

2020-09-19 18:16:55 +00:00
# Generated by Django 3.1 on 2020-09-19 18:15
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateModel(
name='Config',
fields=[
('key', models.CharField(max_length=255, primary_key=True, serialize=False, verbose_name='key')),
('value', models.TextField(default='', verbose_name='value')),
],
options={
'verbose_name': 'configuration',
'verbose_name_plural': 'configurations',
},
),
migrations.CreateModel(
name='Document',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file', models.FileField(unique=True, upload_to='', verbose_name='file')),
('uploaded_at', models.DateTimeField(auto_now_add=True, verbose_name='uploaded at')),
('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_member.document_set+', to='contenttypes.contenttype')),
],
options={
'verbose_name': 'document',
'verbose_name_plural': 'documents',
},
),
migrations.CreateModel(
name='Authorization',
fields=[
('document_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.document')),
('type', models.CharField(choices=[('parental_consent', 'Parental consent'), ('photo_consent', 'Photo consent'), ('sanitary_plug', 'Sanitary plug'), ('scholarship', 'Scholarship')], max_length=32, verbose_name='type')),
],
options={
'verbose_name': 'authorization',
'verbose_name_plural': 'authorizations',
},
bases=('member.document',),
),
migrations.CreateModel(
name='MotivationLetter',
fields=[
('document_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.document')),
],
options={
'verbose_name': 'motivation letter',
'verbose_name_plural': 'motivation letters',
},
bases=('member.document',),
),
migrations.CreateModel(
name='Solution',
fields=[
('document_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.document')),
('problem', models.PositiveSmallIntegerField(verbose_name='problem')),
('final', models.BooleanField(default=False, verbose_name='final solution')),
],
options={
'verbose_name': 'solution',
'verbose_name_plural': 'solutions',
},
bases=('member.document',),
),
migrations.CreateModel(
name='Synthesis',
fields=[
('document_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='member.document')),
('source', models.CharField(choices=[('opponent', 'Opponent'), ('rapporteur', 'Rapporteur')], max_length=16, verbose_name='source')),
('round', models.PositiveSmallIntegerField(choices=[(1, 'Round 1'), (2, 'Round 2')], verbose_name='round')),
('final', models.BooleanField(default=False, verbose_name='final synthesis')),
],
options={
'verbose_name': 'synthesis',
'verbose_name_plural': 'syntheses',
},
bases=('member.document',),
),
migrations.CreateModel(
name='TFJMUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('email', models.EmailField(help_text='This should be valid and will be controlled.', max_length=254, unique=True, verbose_name='email')),
('birth_date', models.DateField(default=None, null=True, verbose_name='birth date')),
('gender', models.CharField(choices=[('male', 'Male'), ('female', 'Female'), ('non-binary', 'Non binary')], default=None, max_length=16, null=True, verbose_name='gender')),
('address', models.CharField(default=None, max_length=255, null=True, verbose_name='address')),
('postal_code', models.PositiveIntegerField(default=None, null=True, verbose_name='postal code')),
('city', models.CharField(default=None, max_length=255, null=True, verbose_name='city')),
('country', models.CharField(default='France', max_length=255, null=True, verbose_name='country')),
('phone_number', models.CharField(blank=True, default=None, max_length=20, null=True, verbose_name='phone number')),
('school', models.CharField(default=None, max_length=255, null=True, verbose_name='school')),
('student_class', models.CharField(choices=[('seconde', 'Seconde or less'), ('première', 'Première'), ('terminale', 'Terminale')], default=None, max_length=16, null=True, verbose_name='class')),
('responsible_name', models.CharField(default=None, max_length=255, null=True, verbose_name='responsible name')),
('responsible_phone', models.CharField(default=None, max_length=20, null=True, verbose_name='responsible phone')),
('responsible_email', models.EmailField(default=None, max_length=254, null=True, verbose_name='responsible email')),
('description', models.TextField(default=None, null=True, verbose_name='description')),
('role', models.CharField(choices=[('0admin', 'Admin'), ('1volunteer', 'Organizer'), ('2coach', 'Coach'), ('3participant', 'Participant')], max_length=16)),
('year', models.PositiveIntegerField(default=2020, verbose_name='year')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]