0001_initial.py 3.86 KB
Newer Older
1
# Generated by Django 2.0.3 on 2018-08-19 11:49
Florent Chehab's avatar
Florent Chehab committed
2

Florent Chehab's avatar
Florent Chehab committed
3
import django.core.validators
Florent Chehab's avatar
Florent Chehab committed
4
from django.db import migrations, models
Florent Chehab's avatar
Florent Chehab committed
5
import django.db.models.deletion
6
import rex.models.tools.usefullLinksField
Florent Chehab's avatar
Florent Chehab committed
7
import rex.utils.friendly_path
Florent Chehab's avatar
Florent Chehab committed
8
9
10
11
12
13
14
15
16
17


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
18
19
20
21
22
23
24
25
        migrations.CreateModel(
            name='BasicModule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment', models.TextField()),
                ('usefull_links', rex.models.tools.usefullLinksField.UsefullLinksField(validators=[rex.models.tools.usefullLinksField.validate_usefull_links])),
            ],
        ),
Florent Chehab's avatar
Florent Chehab committed
26
27
28
29
30
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
31
32
                ('local_name', models.CharField(blank=True, max_length=200, null=True)),
                ('area', models.CharField(blank=True, max_length=200, null=True)),
Florent Chehab's avatar
Florent Chehab committed
33
34
            ],
        ),
Florent Chehab's avatar
Florent Chehab committed
35
        migrations.CreateModel(
Florent Chehab's avatar
Florent Chehab committed
36
37
38
            name='Country',
            fields=[
                ('name', models.CharField(max_length=200)),
39
                ('iso_alpha2_code', models.CharField(max_length=2, primary_key=True, serialize=False)),
40
41
42
43
44
45
46
                ('iso_alpha3_code', models.CharField(max_length=3, unique=True)),
                ('region_name', models.CharField(max_length=200)),
                ('region_un_code', models.CharField(max_length=3)),
                ('sub_region_name', models.CharField(blank=True, max_length=200, null=True)),
                ('sub_region_un_code', models.CharField(blank=True, max_length=3, null=True)),
                ('intermediate_region_name', models.CharField(blank=True, max_length=200, null=True)),
                ('intermediate_region_un_code', models.CharField(blank=True, max_length=3, null=True)),
Florent Chehab's avatar
Florent Chehab committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
            ],
        ),
        migrations.CreateModel(
            name='MainCampus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, null=True)),
                ('comment', models.TextField(blank=True, null=True)),
                ('lat', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-85.05112878), django.core.validators.MaxValueValidator(85.05112878)])),
                ('lon', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
                ('city', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='rex.City')),
            ],
            options={
                'abstract': False,
            },
        ),
Florent Chehab's avatar
Florent Chehab committed
63
64
        migrations.CreateModel(
            name='University',
Florent Chehab's avatar
Florent Chehab committed
65
66
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
Florent Chehab's avatar
Florent Chehab committed
67
                ('name', models.CharField(max_length=200)),
Florent Chehab's avatar
Florent Chehab committed
68
                ('acronym', models.CharField(blank=True, max_length=20, null=True)),
Florent Chehab's avatar
Florent Chehab committed
69
                ('logo', models.ImageField(default='path/to/my/default/image.jpg', max_length=250, upload_to=rex.utils.friendly_path.friendly_path('uploads/universities/logos/', 'name'))),
Florent Chehab's avatar
Florent Chehab committed
70
                ('main_campus', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='main_campus_of', to='rex.MainCampus')),
Florent Chehab's avatar
Florent Chehab committed
71
72
            ],
        ),
Florent Chehab's avatar
Florent Chehab committed
73
74
75
76
77
        migrations.AddField(
            model_name='city',
            name='country',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='rex.Country'),
        ),
Florent Chehab's avatar
Florent Chehab committed
78
    ]