浏览代码

Support reording form fields in project_template (#71)

Kevin Cummings 6 年之前
父节点
当前提交
b3484e37d8

+ 17 - 0
coderedcms/project_template/website/migrations/0006_auto_20190102_1506.py

@@ -0,0 +1,17 @@
+# Generated by Django 2.1.4 on 2019-01-02 20:06
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('website', '0005_auto_20181214_2214'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='formpagefield',
+            options={'ordering': ['sort_order']},
+        ),
+    ]

+ 3 - 0
coderedcms/project_template/website/models.py

@@ -57,6 +57,9 @@ class FormPageField(CoderedFormField):
     """
     A field that links to a FormPage.
     """
+    class Meta:
+        ordering = ['sort_order']
+
     page = ParentalKey('FormPage', related_name='form_fields')
 
 class FormConfirmEmail(CoderedEmail):