Scot Hacker 2017-02-10 14:11:25 +00:00
commit ea54ed8c1e
7 zmienionych plików z 47 dodań i 73 usunięć

Wyświetl plik

@ -1,12 +1,7 @@
from wagtail.wagtailimages.blocks import ImageChooserBlock
from wagtail.wagtailembeds.blocks import EmbedBlock
from wagtail.wagtailcore.blocks import (
StructBlock,
TextBlock,
StreamBlock,
RichTextBlock,
CharBlock,
ChoiceBlock,
CharBlock, ChoiceBlock, RichTextBlock, StreamBlock, StructBlock, TextBlock,
)

Wyświetl plik

@ -4,23 +4,21 @@ from django.db import models
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.wagtailcore.models import Page, Orderable, Collection
from wagtail.wagtailsearch import index
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailcore.fields import StreamField, RichTextField
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel,
InlinePanel,
FieldRowPanel,
StreamFieldPanel,
MultiFieldPanel,
PageChooserPanel
)
from wagtail.wagtailsnippets.models import register_snippet
from .blocks import BaseStreamBlock
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
from wagtail.contrib.modeladmin.options import (
ModelAdmin, ModelAdminGroup, modeladmin_register)
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel,
PageChooserPanel, StreamFieldPanel,
)
from wagtail.wagtailcore.fields import RichTextField, StreamField
from wagtail.wagtailcore.models import Collection, Orderable, Page
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailsearch import index
from wagtail.wagtailsnippets.models import register_snippet
from .blocks import BaseStreamBlock
@register_snippet
@ -59,7 +57,7 @@ class People(ClusterableModel):
return ''
def __str__(self):
return self.first_name + " " + self.last_name
return '{} {}'.format(self.first_name, self.last_name)
class Meta:
verbose_name = 'Person'
@ -141,22 +139,6 @@ class AboutPage(Page):
# api_fields = ['image', 'body']
def getImageCollections():
# We return all collections to a list that don't have the name root.
try:
collection_images = [(
collection.id, collection.name
) for collection in Collection.objects.all().exclude(
name='Root'
)]
return collection_images
except:
return [('', '')]
def __str__(self):
return self.title
class HomePage(Page):
"""
The Home Page
@ -267,6 +249,7 @@ class MyModelAdminGroup(ModelAdminGroup):
menu_order = 200 # will put in 3rd place (000 being 1st, 100 2nd)
items = (PeopleModelAdmin,)
# When using a ModelAdminGroup class to group several ModelAdmin classes together,
# you only need to register the ModelAdminGroup class with Wagtail:
modeladmin_register(MyModelAdminGroup)

Wyświetl plik

@ -1,5 +1,7 @@
from django import template
from wagtail.wagtailcore.models import Page
from bakerydemo.base.models import FooterText

Wyświetl plik

@ -4,22 +4,20 @@ from django.contrib import messages
from django.db import models
from django.shortcuts import redirect, render
from modelcluster.fields import ParentalKey
from modelcluster.contrib.taggit import ClusterTaggableManager
from modelcluster.fields import ParentalKey
from taggit.models import Tag, TaggedItemBase
from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin, route
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel,
InlinePanel,
StreamFieldPanel,
FieldPanel, InlinePanel, StreamFieldPanel,
)
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailcore.models import Page, Orderable
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailsearch import index
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
from bakerydemo.base.blocks import BaseStreamBlock

Wyświetl plik

@ -1,12 +1,12 @@
from django.db import models
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore import blocks
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailsearch import index
from wagtail.wagtailcore import blocks
from wagtail.wagtailsnippets.models import register_snippet
@ -89,9 +89,7 @@ class BreadPage(Page):
index.SearchField('description'),
]
parent_page_types = [
'BreadsIndexPage'
]
parent_page_types = ['BreadsIndexPage']
class BreadsIndexPage(Page):

Wyświetl plik

@ -121,6 +121,4 @@ class LocationPage(Page):
context['long'] = self.lat_long.split(",")[1]
return context
parent_page_types = [
'LocationsIndexPage'
]
parent_page_types = ['LocationsIndexPage']

Wyświetl plik

@ -1,5 +1,5 @@
from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.models import Query