create base model
This commit is contained in:
parent
db6e26984d
commit
68b4aaa799
3 changed files with 15 additions and 4 deletions
|
@ -6,8 +6,10 @@ from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
|||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
from project.common.models import Entity
|
||||
|
||||
class BlogPage(Page):
|
||||
|
||||
class BlogPage(Entity):
|
||||
main_image = models.ForeignKey(
|
||||
'wagtailimages.Image',
|
||||
null=True,
|
||||
|
|
|
@ -3,7 +3,14 @@ from wagtail.wagtailcore.fields import RichTextField
|
|||
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)
|
||||
|
||||
content_panels = Page.content_panels + [
|
||||
|
|
|
@ -2,8 +2,10 @@ from wagtail.wagtailcore.models import Page
|
|||
from wagtail.wagtailcore.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||
|
||||
from project.common.models import Entity
|
||||
|
||||
class HomePage(Page):
|
||||
|
||||
class HomePage(Entity):
|
||||
is_home = True
|
||||
|
||||
body = RichTextField(blank=True)
|
||||
|
|
Reference in a new issue