Add new migrations related to rooms
The new migrations resemble the extra fields that were asked for by the personnel responsible for room reservations.
- Author
- Maarten 'Vngngdn' Vangeneugden
- Date
- March 6, 2018, 2:30 p.m.
- Hash
- 0c60e5d3df9411964c63f250b38ec5814f53f0cd
- Parent
- ebdc8f1ba55e6b3bc5a9e89a8f2d431cbde142f2
- Modified files
- administration/migrations/0017_auto_20180207_0031.py
- administration/migrations/0018_auto_20180207_0530.py
- administration/migrations/0019_auto_20180306_1317.py
- joeni/settings.py
administration/migrations/0017_auto_20180207_0031.py ¶
34 additions and 0 deletions.
View changes Hide changes
+ |
1 |
|
+ |
2 |
from django.db import migrations, models |
+ |
3 |
import django.db.models.deletion |
+ |
4 |
|
+ |
5 |
|
+ |
6 |
class Migration(migrations.Migration): |
+ |
7 |
|
+ |
8 |
dependencies = [ |
+ |
9 |
('administration', '0016_auto_20180204_2014'), |
+ |
10 |
] |
+ |
11 |
|
+ |
12 |
operations = [ |
+ |
13 |
migrations.AlterField( |
+ |
14 |
model_name='courseevent', |
+ |
15 |
name='room', |
+ |
16 |
field=models.ForeignKey(help_text='The room in which this event will be held.', limit_choices_to={'reservable': True}, on_delete=django.db.models.deletion.PROTECT, to='administration.Room'), |
+ |
17 |
), |
+ |
18 |
migrations.AlterField( |
+ |
19 |
model_name='userdata', |
+ |
20 |
name='study_cellphone', |
+ |
21 |
field=models.CharField(blank=True, help_text='The cellphone number of the person. Prefix 0 can be presented with then national call code in the system.', max_length=64, null=True), |
+ |
22 |
), |
+ |
23 |
migrations.AlterField( |
+ |
24 |
model_name='userdata', |
+ |
25 |
name='titularis_number', |
+ |
26 |
field=models.PositiveSmallIntegerField(blank=True, null=True), |
+ |
27 |
), |
+ |
28 |
migrations.AlterField( |
+ |
29 |
model_name='userdata', |
+ |
30 |
name='titularis_postal_code', |
+ |
31 |
field=models.PositiveSmallIntegerField(blank=True, null=True), |
+ |
32 |
), |
+ |
33 |
] |
+ |
34 |
administration/migrations/0018_auto_20180207_0530.py ¶
20 additions and 0 deletions.
View changes Hide changes
+ |
1 |
|
+ |
2 |
from django.conf import settings |
+ |
3 |
from django.db import migrations, models |
+ |
4 |
import django.db.models.deletion |
+ |
5 |
|
+ |
6 |
|
+ |
7 |
class Migration(migrations.Migration): |
+ |
8 |
|
+ |
9 |
dependencies = [ |
+ |
10 |
('administration', '0017_auto_20180207_0031'), |
+ |
11 |
] |
+ |
12 |
|
+ |
13 |
operations = [ |
+ |
14 |
migrations.AlterField( |
+ |
15 |
model_name='userdata', |
+ |
16 |
name='user', |
+ |
17 |
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='user_data', to=settings.AUTH_USER_MODEL), |
+ |
18 |
), |
+ |
19 |
] |
+ |
20 |
administration/migrations/0019_auto_20180306_1317.py ¶
39 additions and 0 deletions.
View changes Hide changes
+ |
1 |
|
+ |
2 |
from django.db import migrations, models |
+ |
3 |
|
+ |
4 |
|
+ |
5 |
class Migration(migrations.Migration): |
+ |
6 |
|
+ |
7 |
dependencies = [ |
+ |
8 |
('administration', '0018_auto_20180207_0530'), |
+ |
9 |
] |
+ |
10 |
|
+ |
11 |
operations = [ |
+ |
12 |
migrations.AddField( |
+ |
13 |
model_name='room', |
+ |
14 |
name='electrical_plugs', |
+ |
15 |
field=models.PositiveSmallIntegerField(default=0, help_text='The amount of electrical plugs that are available to the people for free use. Electrical plugs that are more or less constantly occupied by permanent equipment (such as computers, beamers, ...) are excluded from counting.'), |
+ |
16 |
preserve_default=False, |
+ |
17 |
), |
+ |
18 |
migrations.AddField( |
+ |
19 |
model_name='room', |
+ |
20 |
name='exterior_window', |
+ |
21 |
field=models.BooleanField(default=True, help_text='Indicates if this room has a window to the outside.'), |
+ |
22 |
), |
+ |
23 |
migrations.AddField( |
+ |
24 |
model_name='room', |
+ |
25 |
name='loose_tables', |
+ |
26 |
field=models.BooleanField(default=True, help_text="If true, the tables in this room can be moved freely. If false, they're bolted down in their positions."), |
+ |
27 |
), |
+ |
28 |
migrations.AddField( |
+ |
29 |
model_name='room', |
+ |
30 |
name='software_available', |
+ |
31 |
field=models.TextField(blank=True, help_text='Some software used at the university is proprietary, and thus not available at every system. If certain software is installed on the computers in this room that cannot be found on other computers, list them here.'), |
+ |
32 |
), |
+ |
33 |
migrations.AlterField( |
+ |
34 |
model_name='room', |
+ |
35 |
name='seats', |
+ |
36 |
field=models.PositiveSmallIntegerField(help_text='The amount of available seats in this room.'), |
+ |
37 |
), |
+ |
38 |
] |
+ |
39 |
joeni/settings.py ¶
1 addition and 1 deletion.
View changes Hide changes
1 |
1 |
Django settings for Joeni project. |
2 |
2 |
|
3 |
3 |
Generated by 'django-admin startproject' using Django 2.0b1. |
4 |
4 |
|
5 |
5 |
For more information on this file, see |
6 |
6 |
https://docs.djangoproject.com/en/dev/topics/settings/ |
7 |
7 |
|
8 |
8 |
For the full list of settings and their values, see |
9 |
9 |
https://docs.djangoproject.com/en/dev/ref/settings/ |
10 |
10 |
""" |
11 |
11 |
|
12 |
12 |
import os |
13 |
13 |
|
14 |
14 |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
15 |
15 |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
16 |
16 |
|
17 |
17 |
|
18 |
18 |
# Quick-start development settings - unsuitable for production |
19 |
19 |
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ |
20 |
20 |
|
21 |
21 |
# SECURITY WARNING: keep the secret key used in production secret! |
22 |
22 |
SECRET_KEY = '!2634qc=b*lp0=helzcmvb3+1_wcl!6z@mhzi%p(vg7odq&gfz' |
23 |
23 |
|
+ |
24 |
|
24 |
25 |
# SECURITY WARNING: don't run with debug turned on in production! |
25 |
26 |
DEBUG = True |
26 |
27 |
|
27 |
28 |
|
28 |
- | ALLOWED_HOSTS = [] |
29 |
29 |
|
30 |
30 |
|
31 |
31 |
# Application definition |
32 |
32 |
|
33 |
33 |
INSTALLED_APPS = [ |
34 |
34 |
'django.contrib.admin', |
35 |
35 |
'django.contrib.auth', |
36 |
36 |
'django.contrib.contenttypes', |
37 |
37 |
'django.contrib.humanize', |
38 |
38 |
'django.contrib.sessions', |
39 |
39 |
'django.contrib.messages', |
40 |
40 |
'django.contrib.staticfiles', |
41 |
41 |
'administration', |
42 |
42 |
'agora', |
43 |
43 |
'courses', |
44 |
44 |
'joeni', |
45 |
45 |
] |
46 |
46 |
|
47 |
47 |
MIDDLEWARE = [ |
48 |
48 |
'django.middleware.security.SecurityMiddleware', |
49 |
49 |
'django.middleware.locale.LocaleMiddleware', |
50 |
50 |
'django.middleware.common.CommonMiddleware', |
51 |
51 |
'django.middleware.csrf.CsrfViewMiddleware', |
52 |
52 |
'django.contrib.sessions.middleware.SessionMiddleware', |
53 |
53 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
54 |
54 |
'django.contrib.sessions.middleware.SessionMiddleware', |
55 |
55 |
'django.contrib.messages.middleware.MessageMiddleware', |
56 |
56 |
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
57 |
57 |
'django.middleware.security.SecurityMiddleware', |
58 |
58 |
# Caching middleware |
59 |
59 |
'django.middleware.cache.UpdateCacheMiddleware', |
60 |
60 |
'django.middleware.common.CommonMiddleware', |
61 |
61 |
'django.middleware.cache.FetchFromCacheMiddleware', |
62 |
62 |
] |
63 |
63 |
|
64 |
64 |
# Caching settings |
65 |
65 |
CACHE_MIDDLEWARE_ALIAS = 'default' |
66 |
66 |
CACHE_MIDDLEWARE_SECONDS = 300 |
67 |
67 |
CACHE_MIDDLEWARE_KEY_PREFIX = '' |
68 |
68 |
|
69 |
69 |
ROOT_URLCONF = 'joeni.urls' |
70 |
70 |
|
71 |
71 |
TEMPLATES = [ |
72 |
72 |
{ |
73 |
73 |
'BACKEND': 'django.template.backends.django.DjangoTemplates', |
74 |
74 |
'DIRS': [os.path.join(BASE_DIR, 'templates')], |
75 |
75 |
'APP_DIRS': True, |
76 |
76 |
'OPTIONS': { |
77 |
77 |
'context_processors': [ |
78 |
78 |
'django.template.context_processors.debug', |
79 |
79 |
'django.template.context_processors.request', |
80 |
80 |
'django.contrib.auth.context_processors.auth', |
81 |
81 |
'django.contrib.messages.context_processors.messages', |
82 |
82 |
], |
83 |
83 |
}, |
84 |
84 |
}, |
85 |
85 |
] |
86 |
86 |
|
87 |
87 |
#WSGI_APPLICATION = 'joeni.wsgi.application' |
88 |
88 |
|
89 |
89 |
|
90 |
90 |
# Database |
91 |
91 |
# https://docs.djangoproject.com/en/dev/ref/settings/#databases |
92 |
92 |
|
93 |
93 |
DATABASES = { |
94 |
94 |
'default': { |
95 |
95 |
'ENGINE': 'django.db.backends.sqlite3', |
96 |
96 |
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
97 |
97 |
} |
98 |
98 |
} |
99 |
99 |
|
100 |
100 |
# Page to display when a user needs / wants to log in |
101 |
101 |
LOGIN_URL = '/administration/login' |
102 |
102 |
|
103 |
103 |
# Custom User model |
104 |
104 |
AUTH_USER_MODEL = 'administration.User' |
105 |
105 |
|
106 |
106 |
# Password validation |
107 |
107 |
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators |
108 |
108 |
|
109 |
109 |
AUTH_PASSWORD_VALIDATORS = [] |
110 |
110 |
if not DEBUG: |
111 |
111 |
# XXX: For testing and easily creating new accounts, I've disabled the |
112 |
112 |
# validators to make it easier to work with. |
113 |
113 |
AUTH_PASSWORD_VALIDATORS = [ |
114 |
114 |
{ |
115 |
115 |
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
116 |
116 |
}, |
117 |
117 |
{ |
118 |
118 |
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
119 |
119 |
}, |
120 |
120 |
{ |
121 |
121 |
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
122 |
122 |
}, |
123 |
123 |
{ |
124 |
124 |
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
125 |
125 |
}, |
126 |
126 |
] |
127 |
127 |
|
128 |
128 |
CACHES = { |
129 |
129 |
'default': { |
130 |
130 |
'BACKEND': 'django.core.cache.backends.dummy.DummyCache', |
131 |
131 |
} |
132 |
132 |
} |
133 |
133 |
|
134 |
134 |
# Internationalization |
135 |
135 |
# https://docs.djangoproject.com/en/dev/topics/i18n/ |
136 |
136 |
|
137 |
137 |
LANGUAGE_CODE = 'en-us' |
138 |
138 |
|
139 |
139 |
TIME_ZONE = 'UTC' |
140 |
140 |
|
141 |
141 |
USE_I18N = True |
142 |
142 |
|
143 |
143 |
USE_L10N = True |
144 |
144 |
|
145 |
145 |
USE_TZ = True |
146 |
146 |
|
147 |
147 |
|
148 |
148 |
# Static files (CSS, JavaScript, Images) |
149 |
149 |
# https://docs.djangoproject.com/en/dev/howto/static-files/ |
150 |
150 |
|
151 |
151 |
STATICFILES_DIRS = [ |
152 |
152 |
BASE_DIR + "/static", |
153 |
153 |
] |
154 |
154 |
#STATIC_ROOT = BASE_DIR + '/static/' |
155 |
155 |
STATIC_URL = '/static/' |
156 |
156 |
MEDIA_URL = '/media/' |
157 |
157 |