Renames the module from ‘personalisation’ to ‘wagtail_personalisation’
@ -11,18 +11,18 @@ class Migration(migrations.Migration):
|
|||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0008_devicerule'),
|
('wagtail_personalisation', '0008_devicerule'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='HomePage',
|
name='HomePage',
|
||||||
fields=[
|
fields=[
|
||||||
('personalisablepage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='personalisation.PersonalisablePage')),
|
('personalisablepage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtail_personalisation.PersonalisablePage')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
||||||
},
|
},
|
||||||
bases=('personalisation.personalisablepage',),
|
bases=('wagtail_personalisation.personalisablepage',),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from personalisation.models import PersonalisablePage
|
from wagtail_personalisation.models import PersonalisablePage
|
||||||
|
|
||||||
|
|
||||||
class HomePage(PersonalisablePage):
|
class HomePage(PersonalisablePage):
|
||||||
|
@ -60,7 +60,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
|
||||||
'personalisation',
|
'wagtail_personalisation',
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
2
setup.py
@ -21,7 +21,7 @@ docs_require = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='wagtail-personalisation',
|
name='wagtail_personalisation',
|
||||||
version='0.1.0',
|
version='0.1.0',
|
||||||
description='A Wagtail add-on for showing personalized content',
|
description='A Wagtail add-on for showing personalized content',
|
||||||
author='Lab Digital BV',
|
author='Lab Digital BV',
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.db.models import F
|
from django.db.models import F
|
||||||
from personalisation.models import Segment
|
from wagtail_personalisation.models import Segment
|
||||||
from personalisation.rules import AbstractBaseRule
|
from wagtail_personalisation.rules import AbstractBaseRule
|
||||||
from personalisation.utils import create_segment_dictionary
|
from wagtail_personalisation.utils import create_segment_dictionary
|
||||||
|
|
||||||
|
|
||||||
class BaseSegmentsAdapter(object):
|
class BaseSegmentsAdapter(object):
|
@ -1,7 +1,7 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from personalisation import models, rules
|
from wagtail_personalisation import models, rules
|
||||||
|
|
||||||
|
|
||||||
class UserIsLoggedInRuleAdminInline(admin.TabularInline):
|
class UserIsLoggedInRuleAdminInline(admin.TabularInline):
|
@ -1,7 +1,7 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from personalisation import views
|
from wagtail_personalisation import views
|
||||||
|
|
||||||
app_name = 'segment'
|
app_name = 'segment'
|
||||||
|
|
@ -6,4 +6,4 @@ from django.utils.module_loading import import_string
|
|||||||
segments_adapter = import_string(getattr(
|
segments_adapter = import_string(getattr(
|
||||||
settings,
|
settings,
|
||||||
'PERSONALISATION_SEGMENTS_ADAPTER',
|
'PERSONALISATION_SEGMENTS_ADAPTER',
|
||||||
'personalisation.adapters.SessionSegmentsAdapter'))()
|
'wagtail_personalisation.adapters.SessionSegmentsAdapter'))()
|
@ -1,7 +1,7 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from personalisation.models import Segment
|
from wagtail_personalisation.models import Segment
|
||||||
from wagtail.wagtailcore import blocks
|
from wagtail.wagtailcore import blocks
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
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')),
|
('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')),
|
||||||
('is_segmented', models.BooleanField(default=False)),
|
('is_segmented', models.BooleanField(default=False)),
|
||||||
('canonical_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='variations', to='personalisation.PersonalisablePage')),
|
('canonical_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='variations', to='wagtail_personalisation.PersonalisablePage')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
||||||
@ -60,7 +60,7 @@ class Migration(migrations.Migration):
|
|||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('start_time', models.TimeField(verbose_name='Starting time')),
|
('start_time', models.TimeField(verbose_name='Starting time')),
|
||||||
('end_time', models.TimeField(verbose_name='Ending time')),
|
('end_time', models.TimeField(verbose_name='Ending time')),
|
||||||
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='personalisation_timerule_related', related_query_name='personalisation_timerules', to='personalisation.Segment')),
|
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtail_personalisation_timerule_related', related_query_name='wagtail_personalisation_timerules', to='wagtail_personalisation.Segment')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
||||||
@ -73,7 +73,7 @@ class Migration(migrations.Migration):
|
|||||||
('operator', models.CharField(choices=[('more_than', 'More than'), ('less_than', 'Less than'), ('equal_to', 'Equal to')], default='ht', max_length=20)),
|
('operator', models.CharField(choices=[('more_than', 'More than'), ('less_than', 'Less than'), ('equal_to', 'Equal to')], default='ht', max_length=20)),
|
||||||
('count', models.PositiveSmallIntegerField(default=0, null=True)),
|
('count', models.PositiveSmallIntegerField(default=0, null=True)),
|
||||||
('counted_page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.Page')),
|
('counted_page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.Page')),
|
||||||
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='personalisation_visitcountrule_related', related_query_name='personalisation_visitcountrules', to='personalisation.Segment')),
|
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtail_personalisation_visitcountrule_related', related_query_name='wagtail_personalisation_visitcountrules', to='wagtail_personalisation.Segment')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
||||||
@ -82,11 +82,11 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='referralrule',
|
model_name='referralrule',
|
||||||
name='segment',
|
name='segment',
|
||||||
field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='personalisation_referralrule_related', related_query_name='personalisation_referralrules', to='personalisation.Segment'),
|
field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtail_personalisation_referralrule_related', related_query_name='wagtail_personalisation_referralrules', to='wagtail_personalisation.Segment'),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='personalisablepage',
|
model_name='personalisablepage',
|
||||||
name='segment',
|
name='segment',
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='segments', to='personalisation.Segment'),
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='segments', to='wagtail_personalisation.Segment'),
|
||||||
),
|
),
|
||||||
]
|
]
|
@ -10,7 +10,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0001_initial'),
|
('wagtail_personalisation', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -20,7 +20,7 @@ class Migration(migrations.Migration):
|
|||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('query_parameter', models.TextField(verbose_name='The query parameter to search for')),
|
('query_parameter', models.TextField(verbose_name='The query parameter to search for')),
|
||||||
('query_value', models.TextField(verbose_name='The value of the parameter to match')),
|
('query_value', models.TextField(verbose_name='The value of the parameter to match')),
|
||||||
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='personalisation_queryrule_related', related_query_name='personalisation_queryrules', to='personalisation.Segment')),
|
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtail_personalisation_queryrule_related', related_query_name='wagtail_personalisation_queryrules', to='wagtail_personalisation.Segment')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
@ -8,7 +8,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0002_auto_20161205_1623'),
|
('wagtail_personalisation', '0002_auto_20161205_1623'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -8,7 +8,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0003_auto_20161206_1005'),
|
('wagtail_personalisation', '0003_auto_20161206_1005'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -10,7 +10,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0004_segment_persistent'),
|
('wagtail_personalisation', '0004_segment_persistent'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -19,7 +19,7 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('is_logged_in', models.BooleanField(default=False)),
|
('is_logged_in', models.BooleanField(default=False)),
|
||||||
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='personalisation_userisloggedinrule_related', related_query_name='personalisation_userisloggedinrules', to='personalisation.Segment')),
|
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtail_personalisation_userisloggedinrule_related', related_query_name='wagtail_personalisation_userisloggedinrules', to='wagtail_personalisation.Segment')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
@ -8,7 +8,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0005_userisloggedinrule'),
|
('wagtail_personalisation', '0005_userisloggedinrule'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -10,7 +10,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0006_segment_match_any'),
|
('wagtail_personalisation', '0006_segment_match_any'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -25,7 +25,7 @@ class Migration(migrations.Migration):
|
|||||||
('fri', models.BooleanField(default=False, verbose_name='Friday')),
|
('fri', models.BooleanField(default=False, verbose_name='Friday')),
|
||||||
('sat', models.BooleanField(default=False, verbose_name='Saturday')),
|
('sat', models.BooleanField(default=False, verbose_name='Saturday')),
|
||||||
('sun', models.BooleanField(default=False, verbose_name='Sunday')),
|
('sun', models.BooleanField(default=False, verbose_name='Sunday')),
|
||||||
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='personalisation_dayrule_related', related_query_name='personalisation_dayrules', to='personalisation.Segment')),
|
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtail_personalisation_dayrule_related', related_query_name='wagtail_personalisation_dayrules', to='wagtail_personalisation.Segment')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
@ -10,7 +10,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('personalisation', '0007_dayrule'),
|
('wagtail_personalisation', '0007_dayrule'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
|||||||
('mobile', models.BooleanField(default=False, verbose_name='Mobile phone')),
|
('mobile', models.BooleanField(default=False, verbose_name='Mobile phone')),
|
||||||
('tablet', models.BooleanField(default=False, verbose_name='Tablet')),
|
('tablet', models.BooleanField(default=False, verbose_name='Tablet')),
|
||||||
('desktop', models.BooleanField(default=False, verbose_name='Desktop')),
|
('desktop', models.BooleanField(default=False, verbose_name='Desktop')),
|
||||||
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='personalisation_devicerule_related', related_query_name='personalisation_devicerules', to='personalisation.Segment')),
|
('segment', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtail_personalisation_devicerule_related', related_query_name='wagtail_personalisation_devicerules', to='wagtail_personalisation.Segment')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
@ -14,8 +14,8 @@ from wagtail.wagtailadmin.edit_handlers import (
|
|||||||
PageChooserPanel, TabbedInterface)
|
PageChooserPanel, TabbedInterface)
|
||||||
from wagtail.wagtailcore.models import Page
|
from wagtail.wagtailcore.models import Page
|
||||||
|
|
||||||
from personalisation.forms import AdminPersonalisablePageForm
|
from wagtail_personalisation.forms import AdminPersonalisablePageForm
|
||||||
from personalisation.rules import AbstractBaseRule
|
from wagtail_personalisation.rules import AbstractBaseRule
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
@ -17,7 +17,7 @@ from wagtail.wagtailadmin.edit_handlers import (
|
|||||||
class AbstractBaseRule(models.Model):
|
class AbstractBaseRule(models.Model):
|
||||||
"""Base for creating rules to segment users with."""
|
"""Base for creating rules to segment users with."""
|
||||||
segment = ParentalKey(
|
segment = ParentalKey(
|
||||||
'personalisation.Segment',
|
'wagtail_personalisation.Segment',
|
||||||
related_name="%(app_label)s_%(class)s_related",
|
related_name="%(app_label)s_%(class)s_related",
|
||||||
related_query_name="%(app_label)s_%(class)ss"
|
related_query_name="%(app_label)s_%(class)ss"
|
||||||
)
|
)
|
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 794 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 845 B After Width: | Height: | Size: 845 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -1,10 +1,10 @@
|
|||||||
from django.template import Library
|
from django.template import Library
|
||||||
from personalisation.app_settings import segments_adapter
|
from wagtail_personalisation.app_settings import segments_adapter
|
||||||
|
|
||||||
register = Library()
|
register = Library()
|
||||||
|
|
||||||
|
|
||||||
@register.inclusion_tag('personalisation/tags/datalayer.html')
|
@register.inclusion_tag('wagtail_personalisation/tags/datalayer.html')
|
||||||
def render_datalayer():
|
def render_datalayer():
|
||||||
"""Render the sessions active segments in a data layer script tag."""
|
"""Render the sessions active segments in a data layer script tag."""
|
||||||
segments = segments_adapter.get_all_segments()
|
segments = segments_adapter.get_all_segments()
|
@ -5,7 +5,7 @@ from django.shortcuts import get_object_or_404, reverse
|
|||||||
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
|
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
|
||||||
from wagtail.contrib.modeladmin.views import IndexView
|
from wagtail.contrib.modeladmin.views import IndexView
|
||||||
|
|
||||||
from personalisation.models import PersonalisablePage, Segment
|
from wagtail_personalisation.models import PersonalisablePage, Segment
|
||||||
|
|
||||||
|
|
||||||
class SegmentModelIndexView(IndexView):
|
class SegmentModelIndexView(IndexView):
|
@ -10,10 +10,10 @@ from wagtail.wagtailadmin.site_summary import SummaryItem
|
|||||||
from wagtail.wagtailadmin.widgets import Button, ButtonWithDropdownFromHook
|
from wagtail.wagtailadmin.widgets import Button, ButtonWithDropdownFromHook
|
||||||
from wagtail.wagtailcore import hooks
|
from wagtail.wagtailcore import hooks
|
||||||
|
|
||||||
from personalisation import admin_urls
|
from wagtail_personalisation import admin_urls
|
||||||
from personalisation.app_settings import segments_adapter
|
from wagtail_personalisation.app_settings import segments_adapter
|
||||||
from personalisation.models import PersonalisablePage, Segment
|
from wagtail_personalisation.models import PersonalisablePage, Segment
|
||||||
from personalisation.utils import impersonate_other_page
|
from wagtail_personalisation.utils import impersonate_other_page
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -24,8 +24,8 @@ def register_admin_urls():
|
|||||||
return [
|
return [
|
||||||
url(r'^personalisation/', include(
|
url(r'^personalisation/', include(
|
||||||
admin_urls,
|
admin_urls,
|
||||||
app_name='personalisation',
|
app_name='wagtail_personalisation',
|
||||||
namespace='personalisation')),
|
namespace='wagtail_personalisation')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ class SegmentSummaryPanel(SummaryItem):
|
|||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
segment_count = Segment.objects.count()
|
segment_count = Segment.objects.count()
|
||||||
target_url = reverse('personalisation_segment_modeladmin_index')
|
target_url = reverse('wagtail_personalisation_segment_modeladmin_index')
|
||||||
title = _("Segments")
|
title = _("Segments")
|
||||||
return mark_safe("""
|
return mark_safe("""
|
||||||
<li class="icon icon-group">
|
<li class="icon icon-group">
|
@ -4,7 +4,7 @@ import factory
|
|||||||
from wagtail.wagtailcore.models import Page
|
from wagtail.wagtailcore.models import Page
|
||||||
from wagtail_factories import PageFactory
|
from wagtail_factories import PageFactory
|
||||||
|
|
||||||
from personalisation.models import PersonalisablePage
|
from wagtail_personalisation.models import PersonalisablePage
|
||||||
from tests.sandbox.pages.models import HomePage
|
from tests.sandbox.pages.models import HomePage
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import datetime
|
|||||||
|
|
||||||
import factory
|
import factory
|
||||||
|
|
||||||
from personalisation import rules
|
from wagtail_personalisation import rules
|
||||||
|
|
||||||
|
|
||||||
class DayRuleFactory(factory.DjangoModelFactory):
|
class DayRuleFactory(factory.DjangoModelFactory):
|
||||||
|
@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
|||||||
|
|
||||||
import factory
|
import factory
|
||||||
|
|
||||||
from personalisation import models
|
from wagtail_personalisation import models
|
||||||
|
|
||||||
|
|
||||||
class SegmentFactory(factory.DjangoModelFactory):
|
class SegmentFactory(factory.DjangoModelFactory):
|
||||||
|
@ -4,7 +4,7 @@ from django.db import models
|
|||||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||||
from wagtail.wagtailcore.fields import RichTextField
|
from wagtail.wagtailcore.fields import RichTextField
|
||||||
|
|
||||||
from personalisation.models import PersonalisablePage
|
from wagtail_personalisation.models import PersonalisablePage
|
||||||
|
|
||||||
|
|
||||||
class HomePage(PersonalisablePage):
|
class HomePage(PersonalisablePage):
|
||||||
|
@ -64,7 +64,7 @@ MIDDLEWARE = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
'personalisation',
|
'wagtail_personalisation',
|
||||||
'tests',
|
'tests',
|
||||||
|
|
||||||
'wagtail.contrib.modeladmin',
|
'wagtail.contrib.modeladmin',
|
||||||
|
@ -4,8 +4,8 @@ import datetime
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from personalisation.models import Segment
|
from wagtail_personalisation.models import Segment
|
||||||
from personalisation.rules import TimeRule
|
from wagtail_personalisation.rules import TimeRule
|
||||||
from tests.factories.rule import (
|
from tests.factories.rule import (
|
||||||
DayRuleFactory, DeviceRuleFactory, QueryRuleFactory, ReferralRuleFactory,
|
DayRuleFactory, DeviceRuleFactory, QueryRuleFactory, ReferralRuleFactory,
|
||||||
TimeRuleFactory, VisitCountRuleFactory)
|
TimeRuleFactory, VisitCountRuleFactory)
|
||||||
|
@ -8,7 +8,7 @@ from freezegun import freeze_time
|
|||||||
from wagtail.wagtailcore.models import Site
|
from wagtail.wagtailcore.models import Site
|
||||||
from wagtail_factories import SiteFactory
|
from wagtail_factories import SiteFactory
|
||||||
|
|
||||||
from personalisation import rules
|
from wagtail_personalisation import rules
|
||||||
|
|
||||||
"""Time Rule tests"""
|
"""Time Rule tests"""
|
||||||
@freeze_time("10:00:00")
|
@freeze_time("10:00:00")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from personalisation.utils import impersonate_other_page
|
from wagtail_personalisation.utils import impersonate_other_page
|
||||||
|
|
||||||
|
|
||||||
class Page(object):
|
class Page(object):
|
||||||
|