Skip to content
Snippets Groups Projects
Commit 4432a081 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Add related pages to the fund page

parent 983a29d8
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-12 15:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0040_page_draft_title'),
('public_funds', '0003_icon_and_related_pages'),
]
operations = [
migrations.CreateModel(
name='FundPageRelatedPage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
('page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page')),
('source_page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_pages', to='public_funds.FundPage')),
],
options={
'ordering': ['sort_order'],
'abstract': False,
},
),
]
......@@ -22,6 +22,10 @@ from opentech.public.utils.models import (
from .blocks import FundBlock
class FundPageRelatedPage(RelatedPage):
source_page = ParentalKey('FundPage', related_name='related_pages')
class FundPage(BasePage):
subpage_types = []
parent_page_types = ['FundIndex']
......@@ -40,6 +44,7 @@ class FundPage(BasePage):
FieldPanel('introduction'),
PageChooserPanel('fund_type', 'funds.FundType'),
StreamFieldPanel('body'),
InlinePanel('related_pages', label="Related pages"),
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment