Re-introducing migrations for base app

pull/2/head
Edd Baldry 2017-02-09 15:50:02 +00:00
rodzic 4899dfb96a
commit 479c993b85
12 zmienionych plików z 196 dodań i 52 usunięć

6
.gitignore vendored
Wyświetl plik

@ -11,3 +11,9 @@ common/CACHE
media/*
bakerydemodb
__pycache__
.*
.vagrant/
/.vagrant/
/Vagrantfile.local
!.gitignore

Wyświetl plik

@ -1 +0,0 @@
1.5:f04bfbf0-1325-4cb4-a0e1-5ce72130f6b6

Wyświetl plik

@ -1 +0,0 @@
1486642324

Wyświetl plik

@ -1 +0,0 @@
f04bfbf0-1325-4cb4-a0e1-5ce72130f6b6

Wyświetl plik

@ -1 +0,0 @@
fbd9456e3df14fd6aba07a3cb6bc8859

Wyświetl plik

@ -1,42 +0,0 @@
from django.db import models
from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel,
StreamFieldPanel,
FieldRowPanel,
InlinePanel,
MultiFieldPanel)
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailcore.fields import StreamField, RichTextField
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
from .blocks import FormPageBlock
from core.models import SiteSettingsTemplateMixin
class FormField(AbstractFormField):
page = ParentalKey('FormPage', related_name='form_fields')
class FormPage(SiteSettingsTemplateMixin, AbstractEmailForm):
header_image = models.ForeignKey(
'core.OvercastImage',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
body = StreamField(FormPageBlock())
thank_you_text = RichTextField(blank=True)
content_panels = AbstractEmailForm.content_panels + [
ImageChooserPanel('header_image'),
StreamFieldPanel('body'),
InlinePanel('form_fields', label="Form fields"),
FieldPanel('thank_you_text', classname="full"),
MultiFieldPanel([
FieldRowPanel([
FieldPanel('from_address', classname="col6"),
FieldPanel('to_address', classname="col6"),
]),
FieldPanel('subject'),
], "Email"),
]

Wyświetl plik

@ -0,0 +1,100 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-09 15:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailembeds.blocks
import wagtail.wagtailimages.blocks
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailimages', '0017_reduce_focal_point_key_max_length'),
('wagtailcore', '0032_add_bulk_delete_page_permission'),
]
operations = [
migrations.CreateModel(
name='AboutPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False)),))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='About page detail')),
('image', models.ForeignKey(blank=True, help_text='Location image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
migrations.CreateModel(
name='FormField',
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)),
('label', models.CharField(help_text='The label of the form field', max_length=255, verbose_name='label')),
('field_type', models.CharField(choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], max_length=16, verbose_name='field type')),
('required', models.BooleanField(default=True, verbose_name='required')),
('choices', models.TextField(blank=True, help_text='Comma separated list of choices. Only applicable in checkboxes, radio and dropdown.', verbose_name='choices')),
('default_value', models.CharField(blank=True, help_text='Default value. Comma separated values supported for checkboxes.', max_length=255, verbose_name='default value')),
('help_text', models.CharField(blank=True, max_length=255, verbose_name='help text')),
],
options={
'abstract': False,
'ordering': ['sort_order'],
},
),
migrations.CreateModel(
name='FormPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('to_address', models.CharField(blank=True, help_text='Optional - form submissions will be emailed to these addresses. Separate multiple addresses by comma.', max_length=255, verbose_name='to address')),
('from_address', models.CharField(blank=True, max_length=255, verbose_name='from address')),
('subject', models.CharField(blank=True, max_length=255, verbose_name='subject')),
('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False)),))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))))),
('thank_you_text', wagtail.wagtailcore.fields.RichTextField(blank=True)),
('header_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
migrations.CreateModel(
name='GalleryPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
('introduction', models.TextField(blank=True, help_text='Text to describe the index page')),
('image', models.ForeignKey(blank=True, help_text='Location listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
migrations.CreateModel(
name='People',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=254, verbose_name='First name')),
('last_name', models.CharField(max_length=254, verbose_name='Last name')),
('job_title', models.CharField(max_length=254, verbose_name='Job title')),
('image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
],
options={
'verbose_name_plural': 'People',
'verbose_name': 'Person',
},
),
migrations.AddField(
model_name='formfield',
name='page',
field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='form_fields', to='base.FormPage'),
),
]

Wyświetl plik

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-09 15:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='gallerypage',
name='choices',
field=models.CharField(default='', max_length=255),
preserve_default=False,
),
]

Wyświetl plik

@ -2,15 +2,22 @@ from __future__ import unicode_literals
from django.db import models
from modelcluster.fields import ParentalKey
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
from wagtail.wagtailcore.fields import StreamField, RichTextField
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, InlinePanel, FieldRowPanel, StreamFieldPanel)
FieldPanel,
InlinePanel,
FieldRowPanel,
StreamFieldPanel,
MultiFieldPanel
)
from wagtail.wagtailsnippets.models import register_snippet
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
from blocks import BaseStreamBlock
from .blocks import BaseStreamBlock
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
@register_snippet
@ -138,7 +145,7 @@ class GalleryPage(Page):
blank=True)
content_panels = Page.content_panels + [
FieldPanel('choices'),
# FieldPanel('choices'),
ImageChooserPanel('image'),
FieldPanel('introduction')
]
@ -153,3 +160,32 @@ class GalleryPage(Page):
]
# api_fields = ['introduction']
class FormField(AbstractFormField):
page = ParentalKey('FormPage', related_name='form_fields')
class FormPage(AbstractEmailForm):
header_image = models.ForeignKey(
'wagtailimages.Image',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
body = StreamField(BaseStreamBlock())
thank_you_text = RichTextField(blank=True)
content_panels = AbstractEmailForm.content_panels + [
ImageChooserPanel('header_image'),
StreamFieldPanel('body'),
InlinePanel('form_fields', label="Form fields"),
FieldPanel('thank_you_text', classname="full"),
MultiFieldPanel([
FieldRowPanel([
FieldPanel('from_address', classname="col6"),
FieldPanel('to_address', classname="col6"),
]),
FieldPanel('subject'),
], "Email"),
]

Wyświetl plik

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-09 15:14
# Generated by Django 1.10.5 on 2017-02-09 15:42
from __future__ import unicode_literals
from django.db import migrations, models
@ -13,8 +13,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailimages', '0017_reduce_focal_point_key_max_length'),
('wagtailcore', '0032_add_bulk_delete_page_permission'),
('wagtailimages', '0018_remove_rendition_filter'),
]
operations = [

Wyświetl plik

@ -0,0 +1,27 @@
/* Responsive image/video classes */
/* line 2, /vagrant/bakerydemo/static/css/main.scss */
.rich-text img {
max-width: 100%;
height: auto; }
/* line 6, /vagrant/bakerydemo/static/css/main.scss */
.richtext-image.left {
float: left; }
/* line 9, /vagrant/bakerydemo/static/css/main.scss */
.richtext-image.right {
float: right; }
/* line 12, /vagrant/bakerydemo/static/css/main.scss */
.responsive-object {
position: relative; }
/* line 17, /vagrant/bakerydemo/static/css/main.scss */
.responsive-object iframe,
.responsive-object object,
.responsive-object embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%; }