joeni

0001_initial.py

1
# Generated by Django 2.0b1 on 2017-11-18 22:03
2
3
import administration.models
4
from django.conf import settings
5
import django.contrib.auth.models
6
import django.contrib.auth.validators
7
import django.core.validators
8
from django.db import migrations, models
9
import django.db.models.deletion
10
import django.utils.timezone
11
import uuid
12
13
14
class Migration(migrations.Migration):
15
16
    initial = True
17
18
    dependencies = [
19
    ]
20
21
    operations = [
22
        migrations.CreateModel(
23
            name='User',
24
            fields=[
25
                ('password', models.CharField(max_length=128, verbose_name='password')),
26
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
27
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
28
                ('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')),
29
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
30
                ('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')),
31
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
32
                ('number', models.PositiveIntegerField(help_text='The number assigned to this user.', primary_key=True, serialize=False)),
33
                ('created', models.DateField(auto_now_add=True)),
34
                ('passphrase', models.CharField(help_text='The passphrase used for this account. This field must only contain hashed information.', max_length=512)),
35
                ('first_name', models.CharField(max_length=64)),
36
                ('last_name', models.CharField(max_length=64)),
37
                ('title', models.CharField(blank=True, help_text='The academic title of this user, if applicable.', max_length=64)),
38
                ('DOB', models.DateField(editable=False, help_text='The date of birth of this user.')),
39
                ('POB', models.CharField(editable=False, help_text='The place of birth of this user.', max_length=64)),
40
                ('nationality', models.CharField(help_text='The current nationality of this user.', max_length=64)),
41
                ('national_registry_number', models.BigIntegerField(editable=False, help_text='The assigned national registry number of this user.', unique=True)),
42
                ('civil_status', models.CharField(choices=[('Single', 'Single'), ('Married', 'Married'), ('Divorced', 'Divorced'), ('Widowed', 'Widowed'), ('Partnership', 'Partnership')], help_text='The civil/marital status of the user.', max_length=32)),
43
                ('is_staff', models.BooleanField(default=False, help_text="Determines if this user is part of the university's staff.")),
44
                ('is_student', models.BooleanField(default=True, help_text='Indicates if this user is a student at the university.')),
45
                ('home_street', models.CharField(max_length=64)),
46
                ('home_number', models.PositiveSmallIntegerField()),
47
                ('home_bus', models.PositiveSmallIntegerField()),
48
                ('home_postal_code', models.PositiveSmallIntegerField()),
49
                ('home_country', models.CharField(max_length=64)),
50
                ('home_telephone', models.CharField(help_text='The telephone number for the house address. Prefix 0 can be presented with the national call code in the system.', max_length=64)),
51
                ('study_street', models.CharField(max_length=64)),
52
                ('study_number', models.PositiveSmallIntegerField()),
53
                ('study_bus', models.PositiveSmallIntegerField()),
54
                ('study_postal_code', models.PositiveSmallIntegerField()),
55
                ('study_country', models.CharField(max_length=64)),
56
                ('study_telephone', models.CharField(help_text='The telephone number for the study address. Prefix 0 can be presented with the national call code in the system.', max_length=64)),
57
                ('study_cellphone', models.CharField(help_text='The cellphone number of the person. Prefix 0 can be presented with then national call code in the system.', max_length=64)),
58
                ('titularis_street', models.CharField(max_length=64)),
59
                ('titularis_number', models.PositiveSmallIntegerField()),
60
                ('titularis_bus', models.PositiveSmallIntegerField()),
61
                ('titularis_postal_code', models.PositiveSmallIntegerField()),
62
                ('titularis_country', models.CharField(max_length=64)),
63
                ('titularis_telephone', models.CharField(help_text='The telephone number of the titularis. Prefix 0 can be presented with the national call code in the system.', max_length=64)),
64
                ('bank_account_number', models.CharField(help_text='The IBAN of this user. No spaces!', max_length=34, validators=[administration.models.validate_IBAN])),
65
                ('BIC', models.CharField(help_text="The BIC of this user's bank.", max_length=11, validators=[administration.models.validate_BIC])),
66
            ],
67
            options={
68
                'verbose_name': 'user',
69
                'verbose_name_plural': 'users',
70
                'abstract': False,
71
            },
72
            managers=[
73
                ('objects', django.contrib.auth.models.UserManager()),
74
            ],
75
        ),
76
        migrations.CreateModel(
77
            name='CourseResult',
78
            fields=[
79
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
80
                ('released', models.DateField(auto_now=True, help_text='The date that this result was last updated.')),
81
                ('first_score', models.PositiveSmallIntegerField(null=True, validators=[django.core.validators.MaxValueValidator(20, "The score mustn't be higher than 20.")])),
82
                ('second_score', models.PositiveSmallIntegerField(null=True, validators=[django.core.validators.MaxValueValidator(20, "The score mustn't be higher than 20.")])),
83
                ('result', models.CharField(choices=[('CRED', 'Credit acquired'), ('FAIL', 'Credit not acquired'), ('TLRD', 'Tolerated'), ('ITLD', 'Tolerance used')], help_text='The final result this record constitutes.', max_length=10)),
84
            ],
85
        ),
86
        migrations.CreateModel(
87
            name='Curriculum',
88
            fields=[
89
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
90
                ('year', models.DateField(auto_now_add=True, db_index=True, help_text='The academic year for which this curriculum is.')),
91
                ('last_modified', models.DateTimeField(auto_now=True, help_text='The last timestamp that this was updated.')),
92
                ('approved', models.NullBooleanField(default=None, help_text='Indicates if this curriculum has been approved. If true, that means the responsible committee has reviewed and approved the student for this curriculum. False otherwise. If review is still pending, the value is NULL. Modifying the curriculum implies this setting is set to NULL again.')),
93
                ('note', models.TextField(blank=True, help_text='Additional notes regarding this curriculum. This has multiple uses. For the student, it is used to clarify any questions, or to motivate why (s)he wants to take a course for which the requirements were not met. The reviewing committee can use this field to argument their decision, especially for when the curriculum is denied.')),
94
            ],
95
        ),
96
        migrations.CreateModel(
97
            name='Degree',
98
            fields=[
99
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
100
                ('first_name', models.CharField(max_length=64)),
101
                ('last_name', models.CharField(max_length=64)),
102
                ('additional_names', models.CharField(max_length=64)),
103
                ('DOB', models.DateField(editable=False)),
104
                ('POB', models.CharField(editable=False, max_length=64)),
105
                ('study', models.CharField(editable=False, max_length=64)),
106
                ('achieved', models.DateField(editable=False)),
107
            ],
108
        ),
109
        migrations.CreateModel(
110
            name='PreRegistration',
111
            fields=[
112
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
113
                ('created', models.DateField(auto_now_add=True)),
114
                ('first_name', models.CharField(help_text='Your first name.', max_length=64)),
115
                ('last_name', models.CharField(help_text='Your last name.', max_length=64)),
116
                ('additional_names', models.CharField(blank=True, help_text='Any additional names.', max_length=64)),
117
                ('title', models.CharField(blank=True, help_text='Any additional titles, prefixes, ...', max_length=64)),
118
                ('DOB', models.DateField(editable=False, help_text='Your date of birth.')),
119
                ('POB', models.CharField(editable=False, help_text='The place you were born.', max_length=64)),
120
                ('nationality', models.CharField(help_text='Your current nationality.', max_length=64)),
121
                ('national_registry_number', models.BigIntegerField(help_text='If you have one, your national registry number.', null=True)),
122
                ('civil_status', models.CharField(choices=[('Single', 'Single'), ('Married', 'Married'), ('Divorced', 'Divorced'), ('Widowed', 'Widowed'), ('Partnership', 'Partnership')], help_text='Your civil/marital status.', max_length=32)),
123
                ('email', models.EmailField(help_text='The e-mail address we will use to communicate until your actual registration.', max_length=254, unique=True)),
124
                ('study_type', models.CharField(choices=[('Diplom contract', 'Diplom contract'), ('Exam contract', 'Exam contract'), ('Credit contract', 'Credit contract')], help_text='The type of study contract you wish to follow.', max_length=32)),
125
                ('document', models.FileField(help_text='Any legal documents regarding your enrollment.', upload_to='pre-enrollment/%Y')),
126
            ],
127
        ),
128
        migrations.CreateModel(
129
            name='Room',
130
            fields=[
131
                ('name', models.CharField(help_text='The name of this room. If more appropriate, this can be the colloquial name.', max_length=20, primary_key=True, serialize=False)),
132
                ('seats', models.PositiveSmallIntegerField(help_text='The amount of available seats in this room. This can be handy for exams for example.')),
133
                ('wheelchair_accessible', models.BooleanField(default=True)),
134
                ('exams_equipped', models.BooleanField(default=True, help_text='Indicates if exams can reasonably be held in this room.')),
135
                ('computers_available', models.PositiveSmallIntegerField(default=False, help_text='Indicates how many computers are available in this room.')),
136
                ('projector_available', models.BooleanField(default=False, help_text='Indicates if a projector is available at this room.')),
137
                ('blackboards_available', models.PositiveSmallIntegerField(help_text='The amount of blackboards available in this room.')),
138
                ('whiteboards_available', models.PositiveSmallIntegerField(help_text='The amount of whiteboards available in this room.')),
139
                ('category', models.CharField(choices=[('LABORATORY', 'Laboratory'), ('CLASS_ROOM', 'Class room'), ('AUDITORIUM', 'Auditorium'), ('PC_ROOM', 'PC room'), ('PUBLIC_ROOM', 'Public room'), ('OFFICE', 'Office'), ('PRIVATE_ROOM', 'Private room'), ('WORKSHOP', 'Workshop'), ('OTHER', 'Other')], help_text='The category that best suits the character of this room.', max_length=16)),
140
                ('reservable', models.BooleanField(default=True, help_text='Indicates if this room can be reserved for something.')),
141
                ('note', models.TextField(blank=True, help_text="If some additional info is required for this room, like a characteristic property (e.g. 'Usually occupied by 2BACH informatics'), state it here.")),
142
            ],
143
        ),
144
        migrations.CreateModel(
145
            name='RoomReservation',
146
            fields=[
147
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
148
                ('timestamp', models.DateTimeField(auto_now_add=True)),
149
                ('start_time', models.DateTimeField(help_text='The time that this reservation starts.')),
150
                ('end_time', models.DateTimeField(help_text='The time that this reservation ends.')),
151
                ('seats', models.PositiveSmallIntegerField(help_text='Indicates how many seats are required. If this is left null, it is assumed the entire room has to be reserved.', null=True)),
152
                ('reason', models.CharField(blank=True, help_text='The reason for this reservation, if useful.', max_length=64)),
153
                ('note', models.TextField(blank=True, help_text='If some additional info is required for this reservation, state it here.')),
154
                ('reservator', models.ForeignKey(editable=False, help_text='The person that made the reservation (and thus responsible).', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
155
                ('room', models.ForeignKey(editable=False, help_text='The room that is being reserved at this point.', limit_choices_to={'reservable': True}, on_delete=django.db.models.deletion.CASCADE, to='administration.Room')),
156
            ],
157
        ),
158
    ]
159