0001_initial.py 1.53 KB
Newer Older
1
# Generated by Django 2.0.3 on 2018-04-23 15:30
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 rex.utils.friendly_path
Florent Chehab's avatar
Florent Chehab committed
6
7
8
9
10
11
12
13
14
15
16


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
Florent Chehab's avatar
Florent Chehab committed
17
18
19
20
21
22
23
24
            name='Country',
            fields=[
                ('name', models.CharField(max_length=200)),
                ('iso_code', models.CharField(max_length=2, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='University',
Florent Chehab's avatar
Florent Chehab committed
25
26
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
Florent Chehab's avatar
Florent Chehab committed
27
28
29
30
31
32
                ('name', models.CharField(max_length=200)),
                ('acronym', models.CharField(max_length=20)),
                ('localization_lat', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-85.05112878), django.core.validators.MaxValueValidator(85.05112878)])),
                ('localization_lon', models.DecimalField(decimal_places=6, max_digits=10, validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
                ('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'))),
                ('country', models.ForeignKey(on_delete='CASCADE', to='rex.Country')),
Florent Chehab's avatar
Florent Chehab committed
33
34
35
            ],
        ),
    ]