From 408ef85d5b7aacc65a830508650f303393c72310 Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Wed, 29 Aug 2018 13:48:49 +0100 Subject: [PATCH] Add migration and new field for images --- .../migrations/0003_customimage_drupal_id.py | 18 ++++++++++++++++++ opentech/images/models.py | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 opentech/images/migrations/0003_customimage_drupal_id.py diff --git a/opentech/images/migrations/0003_customimage_drupal_id.py b/opentech/images/migrations/0003_customimage_drupal_id.py new file mode 100644 index 000000000..c9257618b --- /dev/null +++ b/opentech/images/migrations/0003_customimage_drupal_id.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.2 on 2018-08-29 12:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('images', '0002_customimage_file_hash'), + ] + + operations = [ + migrations.AddField( + model_name='customimage', + name='drupal_id', + field=models.IntegerField(blank=True, editable=False, null=True), + ), + ] diff --git a/opentech/images/models.py b/opentech/images/models.py index 7609b6a04..dbc5e50c8 100644 --- a/opentech/images/models.py +++ b/opentech/images/models.py @@ -9,6 +9,8 @@ from wagtail.images.models import ( # We define our own custom image class to replace wagtailimages.Image, # providing various additional data fields class CustomImage(AbstractImage): + drupal_id = models.IntegerField(null=True, blank=True, editable=False) + alt = models.CharField(max_length=255, blank=True) credit = models.CharField(max_length=255, blank=True) -- GitLab