remove PersonalisablePage model
This commit is contained in:
committed by
Michael van Tellingen
parent
66ed40f8ec
commit
49062d36b4
@ -0,0 +1,30 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.1 on 2017-05-31 04:28
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('wagtail_personalisation', '0008_devicerule'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='personalisablepage',
|
||||||
|
name='canonical_page',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='personalisablepage',
|
||||||
|
name='page_ptr',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='personalisablepage',
|
||||||
|
name='segment',
|
||||||
|
),
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='PersonalisablePage',
|
||||||
|
),
|
||||||
|
]
|
@ -10,7 +10,6 @@ from wagtail.utils.decorators import cached_classmethod
|
|||||||
from wagtail.wagtailadmin.edit_handlers import (
|
from wagtail.wagtailadmin.edit_handlers import (
|
||||||
FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel, ObjectList,
|
FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel, ObjectList,
|
||||||
PageChooserPanel, TabbedInterface)
|
PageChooserPanel, TabbedInterface)
|
||||||
from wagtail.wagtailcore.models import Page
|
|
||||||
|
|
||||||
from wagtail_personalisation.forms import AdminPersonalisablePageForm
|
from wagtail_personalisation.forms import AdminPersonalisablePageForm
|
||||||
from wagtail_personalisation.rules import AbstractBaseRule
|
from wagtail_personalisation.rules import AbstractBaseRule
|
||||||
@ -147,10 +146,6 @@ class AbstractPersonalisablePage(models.Model):
|
|||||||
return not self.canonical_page and self.has_variations
|
return not self.canonical_page and self.has_variations
|
||||||
|
|
||||||
|
|
||||||
class PersonalisablePage(AbstractPersonalisablePage, Page):
|
|
||||||
""" """
|
|
||||||
|
|
||||||
|
|
||||||
@cached_classmethod
|
@cached_classmethod
|
||||||
def get_edit_handler(cls):
|
def get_edit_handler(cls):
|
||||||
"""Add additional edit handlers to pages that are allowed to have
|
"""Add additional edit handlers to pages that are allowed to have
|
||||||
@ -172,4 +167,4 @@ def get_edit_handler(cls):
|
|||||||
return edit_handler.bind_to_model(cls)
|
return edit_handler.bind_to_model(cls)
|
||||||
|
|
||||||
|
|
||||||
PersonalisablePage.get_edit_handler = get_edit_handler
|
AbstractPersonalisablePage.get_edit_handler = get_edit_handler
|
||||||
|
@ -128,7 +128,10 @@ def page_listing_variant_buttons(page, page_perms, is_parent=False):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
model = AbstractPersonalisablePage.get_model()
|
model = AbstractPersonalisablePage.get_model()
|
||||||
personalisable_page = model.objects.filter(pk=page.pk)
|
if model:
|
||||||
|
personalisable_page = model.objects.filter(pk=page.pk)
|
||||||
|
else:
|
||||||
|
personalisable_page = page
|
||||||
segments = Segment.objects.all()
|
segments = Segment.objects.all()
|
||||||
|
|
||||||
if personalisable_page and len(segments) > 0 and not (
|
if personalisable_page and len(segments) > 0 and not (
|
||||||
|
Reference in New Issue
Block a user