diff --git a/opentech/public/people/models.py b/opentech/public/people/models.py index b6ca87aa2fdab1876249b54377940c913295523e..98a7560b18439de2dadc6a3e1a1d3184c8d945f8 100644 --- a/opentech/public/people/models.py +++ b/opentech/public/people/models.py @@ -149,8 +149,7 @@ class PersonPage(FundingMixin, BasePage): InlinePanel('person_types', label='Person types'), FieldPanel('introduction'), StreamFieldPanel('biography'), - InlinePanel('funding', label='Funding'), - ] + ] + FundingMixin.content_panels class PersonIndexPage(BasePage): diff --git a/opentech/public/projects/models.py b/opentech/public/projects/models.py index 5ace6d9dbdf8ed0a82fa66c00203d74cc3b05ef8..91f65f364b723382dd4cd76ef6dcecedeb90e5fc 100644 --- a/opentech/public/projects/models.py +++ b/opentech/public/projects/models.py @@ -116,8 +116,7 @@ class ProjectPage(FundingMixin, BasePage): StreamFieldPanel('body'), InlinePanel('contact_details', label="Contact Details"), InlinePanel('related_pages', label="Related Projects"), - InlinePanel('funding', label="Funding"), - ] + ] + FundingMixin.content_panels class ProjectIndexPage(BasePage): diff --git a/opentech/public/utils/models.py b/opentech/public/utils/models.py index 3b45d94d11b6c8e6f549a92d599371c3debb4aaf..b4505bea983cb511936ec9103b069bb4cab3dc53 100644 --- a/opentech/public/utils/models.py +++ b/opentech/public/utils/models.py @@ -4,6 +4,7 @@ from django.db import models from wagtail.wagtailadmin.edit_handlers import ( FieldPanel, FieldRowPanel, + InlinePanel, MultiFieldPanel, PageChooserPanel, StreamFieldPanel, @@ -287,8 +288,9 @@ class BaseFunding(Orderable): class FundingMixin(models.Model): '''Implements the funding total calculation - You still need to include the InlinePanel('funding') in the child class + You still need to include the content panel in the child class ''' + content_panels = [InlinePanel('funding', label="Funding")] class Meta: abstract = True