From 30615403960d181ae3dbc423a845ed1ad11d921a Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 28 Sep 2020 20:40:09 +0200 Subject: [PATCH] Fuck me hard, git. --- .../lostplaces/migrations/0001_initial.py | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/django_lostplaces/lostplaces/migrations/0001_initial.py b/django_lostplaces/lostplaces/migrations/0001_initial.py index ba1b8f6..d0ec5d3 100644 --- a/django_lostplaces/lostplaces/migrations/0001_initial.py +++ b/django_lostplaces/lostplaces/migrations/0001_initial.py @@ -1,11 +1,11 @@ -# Generated by Django 3.1.1 on 2020-09-17 18:05 +# Generated by Django 3.1.1 on 2020-09-28 18:39 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion import easy_thumbnails.fields -import lostplaces.models +import lostplaces.models.place import taggit.managers @@ -14,11 +14,19 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('taggit', '0003_taggeditem_add_unique_index'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('taggit', '0003_taggeditem_add_unique_index'), ] operations = [ + migrations.CreateModel( + name='Expireable', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_when', models.DateTimeField(auto_now_add=True)), + ('expires_when', models.DateTimeField()), + ], + ), migrations.CreateModel( name='Explorer', fields=[ @@ -26,16 +34,6 @@ class Migration(migrations.Migration): ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='explorer', to=settings.AUTH_USER_MODEL)), ], ), - migrations.CreateModel( - name='ExternalLink', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('url', models.URLField()), - ('label', models.CharField(max_length=100)), - ('submitted_when', models.DateTimeField(auto_now_add=True, null=True)), - ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='external_links', to='lostplaces.explorer')), - ], - ), migrations.CreateModel( name='Place', fields=[ @@ -46,7 +44,7 @@ class Migration(migrations.Migration): ('submitted_when', models.DateTimeField(auto_now_add=True, null=True)), ('location', models.CharField(max_length=50)), ('description', models.TextField()), - ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='place', to='lostplaces.explorer')), + ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='places', to='lostplaces.explorer')), ('tags', taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')), ], options={ @@ -56,11 +54,10 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Voucher', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('expireable_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='lostplaces.expireable')), ('code', models.CharField(max_length=30, unique=True)), - ('created_when', models.DateTimeField(auto_now_add=True)), - ('expires_when', models.DateTimeField()), ], + bases=('lostplaces.expireable',), ), migrations.CreateModel( name='PlaceImage', @@ -68,9 +65,9 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('submitted_when', models.DateTimeField(auto_now_add=True, null=True)), ('description', models.TextField(blank=True)), - ('filename', easy_thumbnails.fields.ThumbnailerImageField(upload_to=lostplaces.models.generate_image_upload_path)), + ('filename', easy_thumbnails.fields.ThumbnailerImageField(upload_to=lostplaces.models.place.generate_image_upload_path)), ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='placeimages', to='lostplaces.place')), - ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='placeimage', to='lostplaces.explorer')), + ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='placeimages', to='lostplaces.explorer')), ], options={ 'abstract': False, @@ -79,9 +76,15 @@ class Migration(migrations.Migration): migrations.CreateModel( name='PhotoAlbum', fields=[ - ('externallink_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='lostplaces.externallink')), - ('place', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='photo_albums', to='lostplaces.place')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('submitted_when', models.DateTimeField(auto_now_add=True, null=True)), + ('url', models.URLField()), + ('label', models.CharField(max_length=100)), + ('place', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='photoalbums', to='lostplaces.place')), + ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='photoalbums', to='lostplaces.explorer')), ], - bases=('lostplaces.externallink',), + options={ + 'abstract': False, + }, ), ]