fixes edit handler
This commit is contained in:
29
src/personalisation/migrations/0024_personalisablepage.py
Normal file
29
src/personalisation/migrations/0024_personalisablepage.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.10.3 on 2016-11-14 12:14
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('wagtailcore', '0030_index_on_pagerevision_created_at'),
|
||||||
|
('personalisation', '0023_auto_20161110_1454'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='PersonalisablePage',
|
||||||
|
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')),
|
||||||
|
('canonical_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='variations', to='personalisation.PersonalisablePage')),
|
||||||
|
('segment', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='segments', to='personalisation.Segment')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
bases=('wagtailcore.page',),
|
||||||
|
),
|
||||||
|
]
|
@ -224,7 +224,7 @@ class PersonalisablePage(Page):
|
|||||||
Segment, related_name='segments', on_delete=models.PROTECT
|
Segment, related_name='segments', on_delete=models.PROTECT
|
||||||
)
|
)
|
||||||
|
|
||||||
personalisation_panels = [
|
variation_panels = [
|
||||||
MultiFieldPanel([
|
MultiFieldPanel([
|
||||||
FieldPanel('segment'),
|
FieldPanel('segment'),
|
||||||
PageChooserPanel('canonical_page'),
|
PageChooserPanel('canonical_page'),
|
||||||
@ -283,7 +283,7 @@ class PersonalisablePage(Page):
|
|||||||
def has_variations(self):
|
def has_variations(self):
|
||||||
return self.variations.exists()
|
return self.variations.exists()
|
||||||
|
|
||||||
|
@cached_classmethod
|
||||||
def get_edit_handler(cls):
|
def get_edit_handler(cls):
|
||||||
tabs = []
|
tabs = []
|
||||||
if cls.content_panels:
|
if cls.content_panels:
|
||||||
|
Reference in New Issue
Block a user