move pages from common to seperate app
This commit is contained in:
parent
18ce50f91a
commit
3c496cd951
6 changed files with 35 additions and 12 deletions
|
@ -1,7 +1,4 @@
|
||||||
from django.db import models
|
|
||||||
from wagtail.wagtailcore.models import Page
|
from wagtail.wagtailcore.models import Page
|
||||||
from wagtail.wagtailcore.fields import RichTextField
|
|
||||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
|
||||||
|
|
||||||
|
|
||||||
class Entity(Page):
|
class Entity(Page):
|
||||||
|
@ -11,11 +8,3 @@ class Entity(Page):
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
|
|
||||||
class SectionIndexPage(Entity):
|
|
||||||
intro = RichTextField(blank=True)
|
|
||||||
hide_list = models.BooleanField(default=False)
|
|
||||||
|
|
||||||
content_panels = Page.content_panels + [
|
|
||||||
FieldPanel('intro', classname="full"),
|
|
||||||
FieldPanel('hide_list')
|
|
||||||
]
|
|
||||||
|
|
0
project/pages/__init__.py
Normal file
0
project/pages/__init__.py
Normal file
|
@ -1,5 +1,5 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.10.3 on 2016-11-28 18:43
|
# Generated by Django 1.10.3 on 2016-11-28 21:29
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
@ -28,4 +28,15 @@ class Migration(migrations.Migration):
|
||||||
},
|
},
|
||||||
bases=('wagtailcore.page',),
|
bases=('wagtailcore.page',),
|
||||||
),
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='SimpleContentPage',
|
||||||
|
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.RichTextField()),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
bases=('wagtailcore.page',),
|
||||||
|
),
|
||||||
]
|
]
|
0
project/pages/migrations/__init__.py
Normal file
0
project/pages/migrations/__init__.py
Normal file
22
project/pages/models.py
Normal file
22
project/pages/models.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
from django.db import models
|
||||||
|
from project.common.models import Entity
|
||||||
|
from wagtail.wagtailcore.models import Page
|
||||||
|
from wagtail.wagtailcore.fields import RichTextField
|
||||||
|
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||||
|
|
||||||
|
|
||||||
|
class SimpleContentPage(Entity):
|
||||||
|
body = RichTextField()
|
||||||
|
|
||||||
|
content_panels = Page.content_panels + [
|
||||||
|
FieldPanel('body', classname="full")
|
||||||
|
]
|
||||||
|
|
||||||
|
class SectionIndexPage(Entity):
|
||||||
|
intro = RichTextField(blank=True)
|
||||||
|
hide_list = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
content_panels = Page.content_panels + [
|
||||||
|
FieldPanel('intro', classname="full"),
|
||||||
|
FieldPanel('hide_list')
|
||||||
|
]
|
|
@ -44,6 +44,7 @@ INSTALLED_APPS = [
|
||||||
'project.blog',
|
'project.blog',
|
||||||
'project.common',
|
'project.common',
|
||||||
'project.home',
|
'project.home',
|
||||||
|
'project.pages',
|
||||||
'project.projects',
|
'project.projects',
|
||||||
'project.search',
|
'project.search',
|
||||||
]
|
]
|
||||||
|
|
Reference in a new issue