# Path: aldryn_gallery/utils.py
# def get_additional_styles():
#     """
#     Get additional styles choices from settings
#     """
#     choices = []
#     raw = getattr(settings, 'GALLERY_STYLES', False)
#     if raw:
#         if isinstance(raw, basestring):
#             raw = raw.split(',')
#         for choice in raw:
#             clean = choice.strip()
#             choices.append((clean.lower(), clean.title()))
#     return choices


from functools import partial
from django.db import models
from django.utils.html import strip_tags
from django.utils.translation import ugettext_lazy as _
from cms.models.pluginmodel import CMSPlugin
from cms.models.fields import PageField
from djangocms_text_ckeditor.fields import HTMLField
from filer.fields.folder import FilerFolderField
from filer.fields.image import FilerImageField
from . import compat
from .utils import get_additional_styles
        models.OneToOneField,
        to=CMSPlugin,
        related_name='+',
        parent_link=True,
    )
else:
    # Once djangoCMS < 3.3.1 support is dropped
    # Remove the explicit cmsplugin_ptr field declarations
    CMSPluginField = partial(
        models.OneToOneField,
        to=CMSPlugin,
        related_name='%(app_label)s_%(class)s',
        parent_link=True,
    )


class GalleryPlugin(CMSPlugin):
    STANDARD = 'standard'

    STYLE_CHOICES = [
        (STANDARD, _('Standard')),
    ]

    ENGINE_CHOICES = (
        ('fade', _('Fade')),
        ('slide', _('Slide'))
    )

    cmsplugin_ptr = CMSPluginField()
    style = models.CharField(

# Path: aldryn_gallery/utils.py
# def get_additional_styles():
#     """
#     Get additional styles choices from settings
#     """
#     choices = []
#     raw = getattr(settings, 'GALLERY_STYLES', False)
#     if raw:
#         if isinstance(raw, basestring):
#             raw = raw.split(',')
#         for choice in raw:
#             clean = choice.strip()
#             choices.append((clean.lower(), clean.title()))
#     return choices


# Path: aldryn_gallery/models.py
from functools import partial
from django.db import models
from django.utils.html import strip_tags
from django.utils.translation import ugettext_lazy as _
from cms.models.pluginmodel import CMSPlugin
from cms.models.fields import PageField
from djangocms_text_ckeditor.fields import HTMLField
from filer.fields.folder import FilerFolderField
from filer.fields.image import FilerImageField
from . import compat
from .utils import get_additional_styles

        models.OneToOneField,
        to=CMSPlugin,
        related_name='+',
        parent_link=True,
    )
else:
    # Once djangoCMS < 3.3.1 support is dropped
    # Remove the explicit cmsplugin_ptr field declarations
    CMSPluginField = partial(
        models.OneToOneField,
        to=CMSPlugin,
        related_name='%(app_label)s_%(class)s',
        parent_link=True,
    )


class GalleryPlugin(CMSPlugin):
    STANDARD = 'standard'

    STYLE_CHOICES = [
        (STANDARD, _('Standard')),
    ]

    ENGINE_CHOICES = (
        ('fade', _('Fade')),
        ('slide', _('Slide'))
    )

    cmsplugin_ptr = CMSPluginField()
    style = models.CharField(

        _('Style'), choices=STYLE_CHOICES + get_additional_styles(), default=STANDARD, max_length=50)