Skip to content

Commit

Permalink
Merge pull request #12 from magicjohnson/master
Browse files Browse the repository at this point in the history
Django 1.7 support
  • Loading branch information
czpython committed Feb 4, 2015
2 parents 56792e5 + c5c3f4c commit d3fd6bf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmsplugin_text_ng/__init__.py
@@ -1 +1,2 @@
__version__ = '0.6'
default_app_config = 'cmsplugin_text_ng.apps.CmsPluginTextNgConfig'
12 changes: 12 additions & 0 deletions cmsplugin_text_ng/apps.py
@@ -0,0 +1,12 @@
from django.apps import AppConfig

from cmsplugin_text_ng.type_registry import register_type


class CmsPluginTextNgConfig(AppConfig):
name = 'cmsplugin_text_ng'
verbose_name = "Django Cms Plugin Text-NG"

def ready(self):
from cmsplugin_text_ng.models import TextNGVariableText
register_type('text', TextNGVariableText)
5 changes: 4 additions & 1 deletion cmsplugin_text_ng/models.py
@@ -1,3 +1,5 @@
from distutils.version import StrictVersion
import django
from django.core.validators import RegexValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
Expand Down Expand Up @@ -72,4 +74,5 @@ class Meta:
verbose_name = _('text')
verbose_name_plural = _('texts')

register_type('text', TextNGVariableText)
if StrictVersion(django.get_version()) < StrictVersion('1.7'):
register_type('text', TextNGVariableText)

0 comments on commit d3fd6bf

Please sign in to comment.