Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.8 migration in 29 commits #15

Merged
merged 26 commits into from
Mar 17, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fc49328
Django: start migrating to 1.8.x (BREAKING CHANGE)
vladimir-mencl-eresearch Feb 2, 2016
51bd7e8
Django 1.8.x: use lazy gettext in settings modules
vladimir-mencl-eresearch Feb 2, 2016
ec94465
Dj 1.8.x: remove deprecated django.contrib.markup
vladimir-mencl-eresearch Feb 2, 2016
ba2478f
Django 1.8.x: de-dup django.contrib.staticfiles
vladimir-mencl-eresearch Feb 2, 2016
a8d12d2
Update python-social-auth to 0.2.14
vladimir-mencl-eresearch Mar 3, 2016
a7a3947
Django 1.8: up dj-registration: fix loading models
vladimir-mencl-eresearch Feb 2, 2016
c6b0acb
Django 1.8.x: fix url imports
vladimir-mencl-eresearch Feb 3, 2016
228570d
Dj18: updt email validation, add strs to translate
vladimir-mencl-eresearch Feb 3, 2016
35053c4
Django 1.8.x: explicitly list all fields on forms
vladimir-mencl-eresearch Feb 3, 2016
1b346cb
Django 1.8: rename kwarg mimetype to content_type
vladimir-mencl-eresearch Feb 3, 2016
ec5aa7d
Django 1.8.x: quote URL names in templates
vladimir-mencl-eresearch Feb 4, 2016
52a24c1
Django 1.8.x: Fix accessing user profiles
vladimir-mencl-eresearch Feb 4, 2016
b3672a0
Django 1.8: uncomment missing STATIC_ROOT setting
vladimir-mencl-eresearch Feb 4, 2016
55c433c
D1.8: replace direct_to_template with TemplateView
vladimir-mencl-eresearch Feb 9, 2016
0595db6
Django1.8: contrib.contenttypes.generic deprecated
vladimir-mencl-eresearch Feb 9, 2016
48fa616
Django 1.8: remove South
vladimir-mencl-eresearch Feb 10, 2016
3c341d4
Dj1.8: avoid warnings: remove unused field options
vladimir-mencl-eresearch Feb 12, 2016
7acf827
Dj1.8: repl longerusername with custom user model
vladimir-mencl-eresearch Feb 22, 2016
10515ea
Django 1.8: archive South migrations
vladimir-mencl-eresearch Feb 23, 2016
486f906
Django 1.8: add new generated initial migrations
vladimir-mencl-eresearch Feb 23, 2016
56eb721
Django1.8: Custom User Model: port auth migrations
vladimir-mencl-eresearch Feb 23, 2016
63a52e9
Django 1.8: locales in management commands
vladimir-mencl-eresearch Feb 24, 2016
5952bfb
Django 1.8 requires non-empty ALLOWED_HOSTS
vladimir-mencl-eresearch Feb 25, 2016
6f85bed
Update logging configuration to Django 1.8 default
vladimir-mencl-eresearch Feb 25, 2016
d658e30
Dj 1.8 logging: filter out DisallowedHost emails
vladimir-mencl-eresearch Feb 25, 2016
6b3a911
Django 1.8: add upgrade documentation
vladimir-mencl-eresearch Feb 25, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Django 1.8: add new generated initial migrations
Generated with:

    ./manage.py makemigrations --name initial

(__init__.py created manually)

Due to the structure of the accounts tables, there is more than one initial migration.

Note: this also includes the migrations generated for accounts.User, the custom
user model replacing django.contrib.auth.User.

Note that accounts.User is also a swappable model (same as django.contrib.auth.User).

And so it is important to also include the swappable property in the generated
migrations. (Without the property also being set in the generated migrations,
the migrations framework does not consider the class swapped out and attempts
to run the migrations for this class even when e.g. auth.User is used, clashing
with the migrations for auth.User and breaking the database initialization).
  • Loading branch information
vladimir-mencl-eresearch committed Mar 17, 2016
commit 486f906341b51e43638657832b46553df1b57dc4
51 changes: 51 additions & 0 deletions accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
import django.utils.timezone
import django.core.validators
import django.contrib.auth.models


class Migration(migrations.Migration):

dependencies = [
]

operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(null=True, verbose_name='last login', blank=True)),
('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.'}, max_length=255, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.', 'invalid')], help_text='Required. 255 characters or fewer. Letters, digits and @/./+/-/_ only.', unique=True, verbose_name='username')),
('first_name', models.CharField(max_length=30, verbose_name='first name', blank=True)),
('last_name', models.CharField(max_length=30, verbose_name='last name', blank=True)),
('email', models.EmailField(max_length=254, verbose_name='email address', blank=True)),
('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')),
],
options={
'db_table': 'auth_user',
'swappable': 'AUTH_USER_MODEL',
'verbose_name': 'user',
'verbose_name_plural': 'users',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('is_social_active', models.BooleanField(default=False)),
],
options={
'permissions': (('overview', 'Can see registered user and respective institutions'),),
},
),
]
37 changes: 37 additions & 0 deletions accounts/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings


class Migration(migrations.Migration):

dependencies = [
('accounts', '0001_initial'),
('auth', '0006_require_contenttypes_0002'),
('edumanage', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='userprofile',
name='institution',
field=models.ForeignKey(to='edumanage.Institution'),
),
migrations.AddField(
model_name='userprofile',
name='user',
field=models.OneToOneField(to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='user',
name='groups',
field=models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Group', blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', verbose_name='groups'),
),
migrations.AddField(
model_name='user',
name='user_permissions',
field=models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Permission', blank=True, help_text='Specific permissions for this user.', verbose_name='user permissions'),
),
]
Empty file added accounts/migrations/__init__.py
Empty file.
263 changes: 263 additions & 0 deletions edumanage/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings
import edumanage.models


class Migration(migrations.Migration):

dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='CatEnrollment',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('cat_inst_id', models.PositiveIntegerField()),
('url', models.CharField(help_text=b'Set to ACTIVE if institution has CAT profiles', max_length=255, null=True, blank=True)),
('cat_instance', models.CharField(max_length=50)),
('ts', models.DateTimeField(auto_now=True)),
('applier', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Contact',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=255, db_column=b'contact_name')),
('email', models.CharField(max_length=80, db_column=b'contact_email')),
('phone', models.CharField(max_length=80, db_column=b'contact_phone')),
],
options={
'verbose_name': 'Contact',
'verbose_name_plural': 'Contacts',
},
),
migrations.CreateModel(
name='Institution',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('ertype', models.PositiveIntegerField(db_column=b'type', choices=[(1, b'IdP only'), (2, b'SP only'), (3, b'IdP and SP')])),
],
),
migrations.CreateModel(
name='InstitutionContactPool',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('contact', models.OneToOneField(to='edumanage.Contact')),
('institution', models.ForeignKey(to='edumanage.Institution')),
],
options={
'verbose_name': 'Instutution Contact (Pool)',
'verbose_name_plural': 'Instutution Contacts (Pool)',
},
),
migrations.CreateModel(
name='InstitutionDetails',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('address_street', models.CharField(max_length=96)),
('address_city', models.CharField(max_length=64)),
('oper_name', models.CharField(help_text='The primary, registered domain name for your institution, eg. example.com.<br>This is used to derive the Operator-Name attribute according to RFC5580, par.4.1, using the REALM namespace.', max_length=24, null=True, blank=True)),
('number_user', models.PositiveIntegerField(help_text='Number of users (individuals) that are eligible to participate in eduroam service', null=True, blank=True)),
('number_id', models.PositiveIntegerField(help_text='Number of issued e-identities (credentials) that may be used for authentication in eduroam service', null=True, blank=True)),
('ts', models.DateTimeField(auto_now=True)),
('contact', models.ManyToManyField(to='edumanage.Contact')),
('institution', models.OneToOneField(to='edumanage.Institution')),
],
options={
'verbose_name': "Institutions' Details",
'verbose_name_plural': 'Institution Details',
},
),
migrations.CreateModel(
name='InstRealm',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('realm', models.CharField(max_length=160)),
('instid', models.ForeignKey(verbose_name=b'Institution', to='edumanage.Institution')),
],
options={
'verbose_name': 'Institution Realm',
'verbose_name_plural': "Institutions' Realms",
},
),
migrations.CreateModel(
name='InstRealmMon',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('mon_type', models.CharField(max_length=16, choices=[(b'localauthn', b'Institution provides account for the NRO to monitor the realm')])),
('realm', models.ForeignKey(to='edumanage.InstRealm')),
],
options={
'verbose_name': 'Institution Monitored Realm',
'verbose_name_plural': 'Institution Monitored Realms',
},
),
migrations.CreateModel(
name='InstServer',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('ertype', models.PositiveIntegerField(db_column=b'type', choices=[(1, b'IdP only'), (2, b'SP only'), (3, b'IdP and SP')])),
('name', models.CharField(help_text='Descriptive label', max_length=80, null=True, blank=True)),
('addr_type', models.CharField(default=b'ipv4', max_length=16, choices=[(b'any', b'Default'), (b'ipv4', b'IPv4 only')])),
('host', models.CharField(help_text='IP address | FQDN hostname', max_length=80)),
('rad_pkt_type', models.CharField(default=b'auth+acct', max_length=48, null=True, blank=True, choices=[(b'auth', b'Handles Access-Request packets only'), (b'acct', b'Handles Accounting-Request packets only'), (b'auth+acct', b'Handles both Access-Request and Accounting-Request packets')])),
('auth_port', models.PositiveIntegerField(default=1812, help_text='Default for RADIUS: 1812', null=True, blank=True)),
('acct_port', models.PositiveIntegerField(default=1813, help_text='Default for RADIUS: 1813', null=True, blank=True)),
('status_server', models.BooleanField(help_text='Do you accept Status-Server requests?')),
('secret', models.CharField(max_length=80)),
('proto', models.CharField(default=b'radius', max_length=12, choices=[(b'radius', b'traditional RADIUS over UDP')])),
('ts', models.DateTimeField(auto_now=True)),
('instid', models.ManyToManyField(default=b'none', related_name='servers', to='edumanage.Institution')),
],
options={
'verbose_name': 'Institution Server',
'verbose_name_plural': "Institutions' Servers",
},
),
migrations.CreateModel(
name='MonLocalAuthnParam',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('eap_method', models.CharField(max_length=16, choices=[(b'PEAP', b'EAP-PEAP'), (b'TTLS', b'EAP-TTLS')])),
('phase2', models.CharField(max_length=16, choices=[(b'PAP', b'PAP'), (b'CHAP', b'CHAP'), (b'MS-CHAPv2', b'MS-CHAPv2')])),
('username', models.CharField(max_length=36)),
('passwp', models.CharField(max_length=80, db_column=b'pass')),
('instrealmmonid', models.OneToOneField(to='edumanage.InstRealmMon')),
],
options={
'verbose_name': 'Monitored Realm (local authn)',
'verbose_name_plural': 'Monitored Realms (local authn)',
},
),
migrations.CreateModel(
name='MonProxybackClient',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(help_text='Descriptive label', max_length=80, null=True, blank=True)),
('host', models.CharField(help_text='IP address | FQDN hostname', max_length=80)),
('status_server', models.BooleanField()),
('secret', models.CharField(max_length=80)),
('proto', models.CharField(max_length=12, choices=[(b'radius', b'traditional RADIUS over UDP')])),
('ts', models.DateTimeField(auto_now=True)),
('instrealmmonid', models.ForeignKey(to='edumanage.InstRealmMon')),
],
options={
'verbose_name': 'Institution Proxyback Client',
'verbose_name_plural': 'Institution Proxyback Clients',
},
),
migrations.CreateModel(
name='Name_i18n',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=80)),
('lang', models.CharField(max_length=5, choices=[(b'en', b'English'), (b'el', b'\xce\x95\xce\xbb\xce\xbb\xce\xb7\xce\xbd\xce\xb9\xce\xba\xce\xac')])),
('object_id', models.PositiveIntegerField(null=True, blank=True)),
('content_type', models.ForeignKey(blank=True, to='contenttypes.ContentType', null=True)),
],
options={
'verbose_name': 'Name (i18n)',
'verbose_name_plural': 'Names (i18n)',
},
),
migrations.CreateModel(
name='Realm',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('country', models.CharField(max_length=5, choices=[(b'NZ', b'New Zealand')])),
('stype', models.PositiveIntegerField(default=0, editable=False)),
('address_street', models.CharField(max_length=32)),
('address_city', models.CharField(max_length=24)),
('ts', models.DateTimeField(auto_now=True)),
('contact', models.ManyToManyField(to='edumanage.Contact')),
],
options={
'verbose_name': 'Realm',
'verbose_name_plural': 'Realms',
},
),
migrations.CreateModel(
name='RealmData',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('number_inst', models.PositiveIntegerField(editable=False)),
('number_user', models.PositiveIntegerField(editable=False)),
('number_id', models.PositiveIntegerField(editable=False)),
('number_IdP', models.PositiveIntegerField(editable=False)),
('number_SP', models.PositiveIntegerField(editable=False)),
('number_IdPSP', models.PositiveIntegerField(editable=False)),
('ts', models.DateTimeField(editable=False)),
('realmid', models.OneToOneField(to='edumanage.Realm')),
],
),
migrations.CreateModel(
name='ServiceLoc',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('longitude', models.DecimalField(max_digits=12, decimal_places=8)),
('latitude', models.DecimalField(max_digits=12, decimal_places=8)),
('address_street', models.CharField(max_length=96)),
('address_city', models.CharField(max_length=64)),
('SSID', models.CharField(max_length=16)),
('enc_level', edumanage.models.MultiSelectField(blank=True, max_length=64, null=True, choices=[(b'WPA/TKIP', b'WPA-TKIP'), (b'WPA/AES', b'WPA-AES'), (b'WPA2/TKIP', b'WPA2-TKIP'), (b'WPA2/AES', b'WPA2-AES')])),
('port_restrict', models.BooleanField()),
('transp_proxy', models.BooleanField()),
('IPv6', models.BooleanField()),
('NAT', models.BooleanField()),
('AP_no', models.PositiveIntegerField()),
('wired', models.BooleanField()),
('ts', models.DateTimeField(auto_now=True)),
('contact', models.ManyToManyField(to='edumanage.Contact', blank=True)),
('institutionid', models.ForeignKey(verbose_name=b'Institution', to='edumanage.Institution')),
],
options={
'verbose_name': 'Service Location',
'verbose_name_plural': 'Service Locations',
},
),
migrations.CreateModel(
name='URL_i18n',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('url', models.CharField(max_length=180, db_column=b'URL')),
('lang', models.CharField(max_length=5, choices=[(b'en', b'English'), (b'el', b'\xce\x95\xce\xbb\xce\xbb\xce\xb7\xce\xbd\xce\xb9\xce\xba\xce\xac')])),
('urltype', models.CharField(max_length=10, db_column=b'type', choices=[(b'info', b'Info'), (b'policy', b'Policy')])),
('object_id', models.PositiveIntegerField(null=True, blank=True)),
('content_type', models.ForeignKey(blank=True, to='contenttypes.ContentType', null=True)),
],
options={
'verbose_name': 'Url (i18n)',
'verbose_name_plural': 'Urls (i18n)',
},
),
migrations.AddField(
model_name='instrealm',
name='proxyto',
field=models.ManyToManyField(help_text='Only IdP and IdP/SP server types are allowed', to='edumanage.InstServer'),
),
migrations.AddField(
model_name='institution',
name='realmid',
field=models.ForeignKey(to='edumanage.Realm'),
),
migrations.AddField(
model_name='catenrollment',
name='inst',
field=models.ForeignKey(to='edumanage.Institution'),
),
migrations.AlterUniqueTogether(
name='instrealmmon',
unique_together=set([('realm', 'mon_type')]),
),
migrations.AlterUniqueTogether(
name='catenrollment',
unique_together=set([('inst', 'cat_instance')]),
),
]
Empty file.