From 3223637471c6c661c331232a08a8caaaf0ada469 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 28 Sep 2020 19:21:09 +0200 Subject: [PATCH] dirty-save --- .../lostplaces/migrations/0002_temp_create.py | 6 +++++- .../lostplaces/migrations/0003_migrate_data.py | 18 ++++++++++++++++-- .../migrations/0004_alter_fields_back.py | 10 +++++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/django_lostplaces/lostplaces/migrations/0002_temp_create.py b/django_lostplaces/lostplaces/migrations/0002_temp_create.py index 5c7f2dc..6774831 100644 --- a/django_lostplaces/lostplaces/migrations/0002_temp_create.py +++ b/django_lostplaces/lostplaces/migrations/0002_temp_create.py @@ -1,7 +1,11 @@ # Generated by Django 3.1.1 on 2020-09-27 17: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 taggit.managers class Migration(migrations.Migration): diff --git a/django_lostplaces/lostplaces/migrations/0003_migrate_data.py b/django_lostplaces/lostplaces/migrations/0003_migrate_data.py index bf1ab08..1b430a1 100644 --- a/django_lostplaces/lostplaces/migrations/0003_migrate_data.py +++ b/django_lostplaces/lostplaces/migrations/0003_migrate_data.py @@ -1,13 +1,27 @@ # Generated by Django 3.1.1 on 2020-09-27 17:40 -from django.db import migrations +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 taggit.managers +from django.apps import apps as global_apps +def migrate_data(apps, schema_editor): + OldModel = apps.get_model('lostplaces', 'ExternalLink') + NewModel = apps.get_model('lostplaces', 'PhotoAlbum') + + print(OldModel, NewModel) class Migration(migrations.Migration): dependencies = [ - ('lostplaces', '0002_auto_20200927_1739'), + ('lostplaces', '0002_temp_create'), ] operations = [ +# migrations.RunPython(migrate_data), ] + diff --git a/django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py b/django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py index 7dd3446..487f186 100644 --- a/django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py +++ b/django_lostplaces/lostplaces/migrations/0004_alter_fields_back.py @@ -1,11 +1,19 @@ # Generated by Django 3.1.1 on 2020-09-27 17:40 +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 taggit.managers +import django.db.models.deletion + class Migration(migrations.Migration): dependencies = [ - ('lostplaces', '0003_auto_20200927_1740'), + ('lostplaces', '0003_migrate_data'), ] operations = [