1
Fork 0

create base model

This commit is contained in:
Jake Howard 2016-11-25 20:23:02 +00:00
parent db6e26984d
commit 68b4aaa799
3 changed files with 15 additions and 4 deletions

View file

@ -6,8 +6,10 @@ from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailsearch import index from wagtail.wagtailsearch import index
from project.common.models import Entity
class BlogPage(Page):
class BlogPage(Entity):
main_image = models.ForeignKey( main_image = models.ForeignKey(
'wagtailimages.Image', 'wagtailimages.Image',
null=True, null=True,

View file

@ -3,7 +3,14 @@ from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailadmin.edit_handlers import FieldPanel from wagtail.wagtailadmin.edit_handlers import FieldPanel
class SectionIndexPage(Page): class Entity(Page):
is_home = False
class Meta:
abstract = True
class SectionIndexPage(Entity):
intro = RichTextField(blank=True) intro = RichTextField(blank=True)
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [

View file

@ -2,10 +2,12 @@ from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailadmin.edit_handlers import FieldPanel from wagtail.wagtailadmin.edit_handlers import FieldPanel
from project.common.models import Entity
class HomePage(Page):
class HomePage(Entity):
is_home = True is_home = True
body = RichTextField(blank=True) body = RichTextField(blank=True)
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [