Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
django CMS 3.5 support*
Browse files Browse the repository at this point in the history
(*) still weirdness that the plugin needs to be rendered in new style
rendering (with separate structure rendering). I'm unsure why this is
the case.

- Not longer supporting django CMS<3.5
- Dropped Django<1.8 support.
  • Loading branch information
stefanfoulis committed Aug 23, 2017
1 parent ff6aa92 commit e5bfa9a
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 330 deletions.
77 changes: 4 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,21 @@
Aldryn Segmentation
===================

Development Status
------------------

### Segment Limter:
- [x] Limiter

### Segment Plugins:
- [x] Fallback
- [x] Segment by Switch (hard switch)
- [x] Segment by Cookie
- [x] Segment by Country
- [x] Segment by Auth Status (is authenticated)
- [x] Overridable

### Segment Pool:
- [x] Registration
- [x] De-registration
- [x] Discovery
- [x] Get override state for segment
- [x] Reset all overrides
- [x] Supports multiple operators

### Toolbar:
- [x] Displays
- [x] Working override states
- [x] Working "Reset all" option
- [x] Displays no. of overrides in Segment menu name

### Tests:

These tests are performed in the test_project.

- [x] Segment logic tests
- [x] Segment Pool tests
- [x] I18N tests
- [x] Multiple operator tests

### Other:
- [x] Move the Country Segment and its related bits to another repo?
- [x] Ensure compatibility with supported Pythons (vs. Django 1.6)
- [x] Python 2.6.x
- [x] Python 2.7.x
- [x] Python 3.3.x
- [x] Python 3.4.x
- [x] Ensure compatibility with supported Djangos (vs. Python 2.7)
- [x] Django 1.4.x
- [x] Django 1.5.x
- [x] Django 1.6.x


Known Issues
------------

This is a list of known issues that are being worked on...

- [ ] UI for the Limit plugin needs some work. Ideas?

- [x] French translation is available (via by translate.google.com)

- [x] Does not seem to work with the new Alias Plugin...
Actually, its just that the AliasPlugin didn't work in Django 1.4.13.
I've submitted a PR to fix this and added tests to help detect and
prevent future issues.


Installation
------------

At this time, the package is not submitted to PyPi, but you can still use pip
if you like. Here's how to get started quickly:

NOTE: At this time, the project has only been tested under:
- Python 2.6, 2.7, 3.3, 3.4
- Django 1.4, 1.5, 1.6
- django CMS 3.0.2 (276fd37b0e49555bafce6c071ca50508de5e4c49 or later)
Requirements:
- python 2.7+ or 3.5+
- Django 1.8+
- django CMS 3.5+

1. Make sure you're using a version of django-CMS that is later than
3.0.2.dev1, otherwise the Segment menu will not appear correctly and likely
the whole toolbar won't render at all.
1. If you're using Python 3, it is recommended also install:
`pip intall pyuca` for better collation of non-EN languages.
1. `pip install https://github.com/aldryn/aldryn-segmentation/archive/master.zip`
1. Add 'aldryn_segmentation' to INSTALLED_APPS in your Django project's settings file
1. `python manage.py schemamigration aldryn_segmentation --initial`
1. `python manage.py migrate aldryn_segmentation`

Optional, but required if you intend to run the test project included in the
Expand Down
16 changes: 2 additions & 14 deletions addon.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
{
"name": "Aldryn Segmentation",
"description": "Provides market segmentation to Aldryn!",
"url": "https://github.com/aldryn/aldryn-segmentation",
"package-name": "aldryn-segmentation",
"installed-apps": [
"aldryn_segmentation"
],
"author": {
"name": "Divio",
"url": "https://www.aldryn.com"
},
"license": {
"name": "BSD"
}
}
"installed-apps": []
}
11 changes: 11 additions & 0 deletions aldryn_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
from aldryn_client import forms


class Form(forms.BaseForm):

def to_settings(self, data, settings):
settings['INSTALLED_APPS'].extend([
'aldryn_segmentation',
])
return settings
2 changes: 0 additions & 2 deletions aldryn_segmentation/cms_plugins/segment_limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def render(self, context, instance, placeholder):
context, instance)
return context


def is_context_appropriate(self, context, instance):
'''
Returns True if any of its children are context-appropriate,
Expand All @@ -41,7 +40,6 @@ def is_context_appropriate(self, context, instance):
num_apt = sum( 1 for child in apt_children if child[1] )
return num_apt > 0


def get_context_appropriate_children(self, context, instance):
from ..segment_pool import SegmentOverride
'''
Expand Down
File renamed without changes.
39 changes: 39 additions & 0 deletions aldryn_segmentation/migrations/0002_auto_20170823_0446.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('aldryn_segmentation', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='authenticatedsegmentpluginmodel',
name='cmsplugin_ptr',
field=models.OneToOneField(parent_link=True, related_name='aldryn_segmentation_authenticatedsegmentpluginmodel', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'),
),
migrations.AlterField(
model_name='cookiesegmentpluginmodel',
name='cmsplugin_ptr',
field=models.OneToOneField(parent_link=True, related_name='aldryn_segmentation_cookiesegmentpluginmodel', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'),
),
migrations.AlterField(
model_name='fallbacksegmentpluginmodel',
name='cmsplugin_ptr',
field=models.OneToOneField(parent_link=True, related_name='aldryn_segmentation_fallbacksegmentpluginmodel', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'),
),
migrations.AlterField(
model_name='segmentlimitpluginmodel',
name='cmsplugin_ptr',
field=models.OneToOneField(parent_link=True, related_name='aldryn_segmentation_segmentlimitpluginmodel', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'),
),
migrations.AlterField(
model_name='switchsegmentpluginmodel',
name='cmsplugin_ptr',
field=models.OneToOneField(parent_link=True, related_name='aldryn_segmentation_switchsegmentpluginmodel', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'),
),
]
125 changes: 0 additions & 125 deletions aldryn_segmentation/south_migrations/0001_initial.py

This file was deleted.

Empty file.
Loading

0 comments on commit e5bfa9a

Please sign in to comment.