0018_auto_20180821_1127.py 1.49 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Generated by Django 2.0.3 on 2018-08-21 09:27

from django.db import migrations, models
import django.db.models.deletion
import rex.utils.friendly_path


class Migration(migrations.Migration):

    dependencies = [
        ('rex', '0017_remove_file_user'),
    ]

    operations = [
        migrations.CreateModel(
            name='UniversityPhoto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', models.ImageField(default='path/to/my/default/image.jpg', max_length=250, upload_to=rex.utils.friendly_path.friendly_path('uploads/universities/photos/', 'name'))),
                ('title', models.CharField(max_length=200)),
                ('description', models.TextField(blank=True, null=True)),
                ('university', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='university_photos', to='rex.University')),
            ],
        ),
        migrations.RemoveField(
            model_name='universityphotos',
            name='photos',
        ),
        migrations.RemoveField(
            model_name='universityphotos',
            name='university',
        ),
        migrations.DeleteModel(
            name='File',
        ),
        migrations.DeleteModel(
            name='UniversityPhotos',
        ),
        migrations.AlterUniqueTogether(
            name='universityphoto',
            unique_together={('university', 'photo')},
        ),
    ]