Browse Source

Amend form model to name imagefield image. Workson #15.

Edd Baldry 8 years ago
parent
commit
600bfc482d
2 changed files with 22 additions and 2 deletions
  1. 20 0
      bakerydemo/base/migrations/0013_auto_20170227_2216.py
  2. 2 2
      bakerydemo/base/models.py

+ 20 - 0
bakerydemo/base/migrations/0013_auto_20170227_2216.py

@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.5 on 2017-02-27 22:16
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('base', '0012_auto_20170222_0756'),
+    ]
+
+    operations = [
+        migrations.RenameField(
+            model_name='formpage',
+            old_name='header_image',
+            new_name='image',
+        ),
+    ]

+ 2 - 2
bakerydemo/base/models.py

@@ -222,7 +222,7 @@ class FormField(AbstractFormField):
 
 
 class FormPage(AbstractEmailForm):
-    header_image = models.ForeignKey(
+    image = models.ForeignKey(
         'wagtailimages.Image',
         null=True,
         blank=True,
@@ -232,7 +232,7 @@ class FormPage(AbstractEmailForm):
     body = StreamField(BaseStreamBlock())
     thank_you_text = RichTextField(blank=True)
     content_panels = AbstractEmailForm.content_panels + [
-        ImageChooserPanel('header_image'),
+        ImageChooserPanel('image'),
         StreamFieldPanel('body'),
         InlinePanel('form_fields', label="Form fields"),
         FieldPanel('thank_you_text', classname="full"),