|
@@ -13,7 +13,8 @@ from wagtail.wagtailadmin.edit_handlers import (
|
|
|
InlinePanel,
|
|
|
FieldRowPanel,
|
|
|
StreamFieldPanel,
|
|
|
- MultiFieldPanel
|
|
|
+ MultiFieldPanel,
|
|
|
+ PageChooserPanel
|
|
|
)
|
|
|
from wagtail.wagtailsnippets.models import register_snippet
|
|
|
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
|
|
@@ -50,21 +51,21 @@ class People(ClusterableModel):
|
|
|
verbose_name_plural = 'People'
|
|
|
|
|
|
|
|
|
-# class AboutLocationRelationship(Orderable, models.Model):
|
|
|
-# """
|
|
|
-# This defines the relationship between the `LocationPage` within the `locations`
|
|
|
-# app and the About page below allowing us to add locations to the about
|
|
|
-# section.
|
|
|
-# """
|
|
|
-# about = ParentalKey(
|
|
|
-# 'About', related_name='location_about_relationship'
|
|
|
-# )
|
|
|
-# locations = models.ForeignKey(
|
|
|
-# 'locations.LocationPage', related_name='about_location_relationship'
|
|
|
-# )
|
|
|
-# panels = [
|
|
|
-# PageChooserPanel('locations')
|
|
|
-# ]
|
|
|
+class AboutLocationRelationship(Orderable, models.Model):
|
|
|
+ """
|
|
|
+ This defines the relationship between the `LocationPage` within the `locations`
|
|
|
+ app and the About page below allowing us to add locations to the about
|
|
|
+ section.
|
|
|
+ """
|
|
|
+ page = ParentalKey(
|
|
|
+ 'AboutPage', related_name='location_about_relationship'
|
|
|
+ )
|
|
|
+ locations = models.ForeignKey(
|
|
|
+ 'locations.LocationPage', related_name='about_location_relationship'
|
|
|
+ )
|
|
|
+ panels = [
|
|
|
+ PageChooserPanel('locations')
|
|
|
+ ]
|
|
|
|
|
|
|
|
|
class AboutPage(Page):
|
|
@@ -91,11 +92,11 @@ class AboutPage(Page):
|
|
|
content_panels = Page.content_panels + [
|
|
|
ImageChooserPanel('image'),
|
|
|
StreamFieldPanel('body'),
|
|
|
- # InlinePanel(
|
|
|
- # 'about_location_relationship',
|
|
|
- # label='Locations',
|
|
|
- # min_num=None
|
|
|
- # ),
|
|
|
+ InlinePanel(
|
|
|
+ 'location_about_relationship',
|
|
|
+ label='Locations',
|
|
|
+ min_num=None
|
|
|
+ ),
|
|
|
]
|
|
|
|
|
|
# parent_page_types = [
|
|
@@ -120,7 +121,7 @@ def getImageCollections():
|
|
|
)]
|
|
|
return collection_images
|
|
|
except:
|
|
|
- return [('','')]
|
|
|
+ return [('', '')]
|
|
|
|
|
|
|
|
|
class GalleryPage(Page):
|