diff --git a/.travis.yml b/.travis.yml
index b02f1b3828..d30204e36b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,6 @@
language: python
env:
- - DJANGO="111"
- - DJANGO="20"
- - DJANGO="21"
+ - DJANGO="22"
- DJANGO="master"
python:
- "3.5"
@@ -16,12 +14,8 @@ script:
matrix:
fast_finish: true
include:
- - python: "2.7"
- env: DJANGO="111"
- - python: "3.4"
- env: DJANGO="111"
- - python: "3.4"
- env: DJANGO="20"
+ - python: "3.5"
+ env: DJANGO="22"
allow_failures:
- env: DJANGO="master"
notifications:
diff --git a/mezzanine/__init__.py b/mezzanine/__init__.py
index 865d0f9985..ed48cdab09 100644
--- a/mezzanine/__init__.py
+++ b/mezzanine/__init__.py
@@ -1,2 +1 @@
-
__version__ = "4.3.1"
diff --git a/mezzanine/accounts/__init__.py b/mezzanine/accounts/__init__.py
index f9a950018d..e480ccd8f8 100644
--- a/mezzanine/accounts/__init__.py
+++ b/mezzanine/accounts/__init__.py
@@ -5,8 +5,6 @@
setting. Some utility functions for probing the profile model are
included below.
"""
-from __future__ import unicode_literals
-
from django.apps import apps
from django.conf import settings
from django.contrib.auth import get_user_model
diff --git a/mezzanine/accounts/admin.py b/mezzanine/accounts/admin.py
index 5fdf3b6a87..6b6b7ce39c 100644
--- a/mezzanine/accounts/admin.py
+++ b/mezzanine/accounts/admin.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.contrib import admin
from django.contrib.auth import get_user_model
from mezzanine.accounts import get_profile_model, ProfileNotConfigured
diff --git a/mezzanine/accounts/defaults.py b/mezzanine/accounts/defaults.py
index 18f46af48b..c255fc489b 100644
--- a/mezzanine/accounts/defaults.py
+++ b/mezzanine/accounts/defaults.py
@@ -9,8 +9,6 @@
that are only read during startup shouldn't be editable, since changing
them would require an application reload.
"""
-from __future__ import unicode_literals
-
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import register_setting
diff --git a/mezzanine/accounts/forms.py b/mezzanine/accounts/forms.py
index 1014fd54d9..8f982eb0e9 100644
--- a/mezzanine/accounts/forms.py
+++ b/mezzanine/accounts/forms.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth.tokens import default_token_generator
from django.db.models import Q
diff --git a/mezzanine/accounts/templatetags/accounts_tags.py b/mezzanine/accounts/templatetags/accounts_tags.py
index f3168a7395..70fc8f60c7 100644
--- a/mezzanine/accounts/templatetags/accounts_tags.py
+++ b/mezzanine/accounts/templatetags/accounts_tags.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from collections import OrderedDict
from django.contrib.auth import get_user_model
diff --git a/mezzanine/accounts/tests.py b/mezzanine/accounts/tests.py
index 5d63846cd2..1ac4cb70d7 100644
--- a/mezzanine/accounts/tests.py
+++ b/mezzanine/accounts/tests.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.contrib.auth import get_user_model
from django.contrib.auth.tokens import default_token_generator
from django.core import mail
diff --git a/mezzanine/accounts/views.py b/mezzanine/accounts/views.py
index be709248fa..74d4b78489 100644
--- a/mezzanine/accounts/views.py
+++ b/mezzanine/accounts/views.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.contrib.auth import (login as auth_login, authenticate,
logout as auth_logout, get_user_model)
from django.contrib.auth.decorators import login_required
diff --git a/mezzanine/bin/runtests.py b/mezzanine/bin/runtests.py
index e82ed1a65b..90ce92e202 100755
--- a/mezzanine/bin/runtests.py
+++ b/mezzanine/bin/runtests.py
@@ -1,6 +1,4 @@
#!/usr/bin/env python
-from __future__ import unicode_literals
-
import atexit
import os
import shutil
diff --git a/mezzanine/blog/__init__.py b/mezzanine/blog/__init__.py
index 03fc4334ee..46e9a56936 100644
--- a/mezzanine/blog/__init__.py
+++ b/mezzanine/blog/__init__.py
@@ -2,6 +2,4 @@
Provides a blogging app with posts, keywords, categories and comments.
Posts can be listed by month, keyword, category or author.
"""
-from __future__ import unicode_literals
-
from mezzanine import __version__ # noqa
diff --git a/mezzanine/blog/admin.py b/mezzanine/blog/admin.py
index 522a37c946..2166ae872e 100644
--- a/mezzanine/blog/admin.py
+++ b/mezzanine/blog/admin.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from copy import deepcopy
from django.contrib import admin
diff --git a/mezzanine/blog/defaults.py b/mezzanine/blog/defaults.py
index 26514e6d79..87bfa2aa45 100644
--- a/mezzanine/blog/defaults.py
+++ b/mezzanine/blog/defaults.py
@@ -9,8 +9,6 @@
that are only read during startup shouldn't be editable, since changing
them would require an application reload.
"""
-from __future__ import unicode_literals
-
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
diff --git a/mezzanine/blog/feeds.py b/mezzanine/blog/feeds.py
index edeeb7bf3d..0189be521c 100644
--- a/mezzanine/blog/feeds.py
+++ b/mezzanine/blog/feeds.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.contrib.syndication.views import Feed, add_domain
diff --git a/mezzanine/blog/forms.py b/mezzanine/blog/forms.py
index 1db7c638d9..fc22b8537c 100644
--- a/mezzanine/blog/forms.py
+++ b/mezzanine/blog/forms.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django import forms
from mezzanine.blog.models import BlogPost
diff --git a/mezzanine/blog/management/base.py b/mezzanine/blog/management/base.py
index b88278b4ac..42d1b99d0e 100644
--- a/mezzanine/blog/management/base.py
+++ b/mezzanine/blog/management/base.py
@@ -1,9 +1,4 @@
-from __future__ import print_function, unicode_literals
-from future.builtins import input, int
-try:
- from urllib.parse import urlparse
-except:
- from urlparse import urlparse
+from urllib.parse import urlparse
from django.contrib.auth import get_user_model
from django.contrib.redirects.models import Redirect
diff --git a/mezzanine/blog/management/commands/import_blogger.py b/mezzanine/blog/management/commands/import_blogger.py
index ebfe964cc1..92c7a77682 100644
--- a/mezzanine/blog/management/commands/import_blogger.py
+++ b/mezzanine/blog/management/commands/import_blogger.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from datetime import datetime, timedelta
from time import timezone
import re
diff --git a/mezzanine/blog/management/commands/import_posterous.py b/mezzanine/blog/management/commands/import_posterous.py
index e6f692b6a6..873816efa0 100644
--- a/mezzanine/blog/management/commands/import_posterous.py
+++ b/mezzanine/blog/management/commands/import_posterous.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from datetime import datetime
import json
import time
diff --git a/mezzanine/blog/management/commands/import_rss.py b/mezzanine/blog/management/commands/import_rss.py
index 72583214f2..9d31883065 100644
--- a/mezzanine/blog/management/commands/import_rss.py
+++ b/mezzanine/blog/management/commands/import_rss.py
@@ -1,13 +1,8 @@
-from __future__ import unicode_literals
-
from datetime import timedelta
from time import timezone
-try:
- from urllib.request import urlopen
- from urllib.parse import urljoin
-except ImportError:
- from urllib import urlopen
- from urlparse import urljoin
+
+from urllib.request import urlopen
+from urllib.parse import urljoin
from django.core.management.base import CommandError
diff --git a/mezzanine/blog/management/commands/import_tumblr.py b/mezzanine/blog/management/commands/import_tumblr.py
index 3d05edea14..e04a0dedd9 100644
--- a/mezzanine/blog/management/commands/import_tumblr.py
+++ b/mezzanine/blog/management/commands/import_tumblr.py
@@ -1,15 +1,8 @@
-from __future__ import print_function
-from __future__ import unicode_literals
-from future.builtins import int
-
from datetime import datetime
from json import loads
from time import sleep
-try:
- from urllib.request import urlopen
-except ImportError:
- from urllib import urlopen
+from urllib.request import urlopen
from django.core.management.base import CommandError
from django.utils.html import strip_tags
diff --git a/mezzanine/blog/management/commands/import_wordpress.py b/mezzanine/blog/management/commands/import_wordpress.py
index 85ed271ecb..c7b1069512 100644
--- a/mezzanine/blog/management/commands/import_wordpress.py
+++ b/mezzanine/blog/management/commands/import_wordpress.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-from future.builtins import int
-
from collections import defaultdict
from datetime import datetime, timedelta
import re
diff --git a/mezzanine/blog/migrations/0001_initial.py b/mezzanine/blog/migrations/0001_initial.py
index 045c98b9f1..b9d3c9ddc4 100644
--- a/mezzanine/blog/migrations/0001_initial.py
+++ b/mezzanine/blog/migrations/0001_initial.py
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import models, migrations
import mezzanine.core.fields
import mezzanine.utils.models
diff --git a/mezzanine/blog/migrations/0002_auto_20150527_1555.py b/mezzanine/blog/migrations/0002_auto_20150527_1555.py
index a5cb65cca7..7db9cdd480 100644
--- a/mezzanine/blog/migrations/0002_auto_20150527_1555.py
+++ b/mezzanine/blog/migrations/0002_auto_20150527_1555.py
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import models, migrations
diff --git a/mezzanine/blog/migrations/0003_auto_20170411_0504.py b/mezzanine/blog/migrations/0003_auto_20170411_0504.py
index c57ae4f3da..ca8683a61a 100644
--- a/mezzanine/blog/migrations/0003_auto_20170411_0504.py
+++ b/mezzanine/blog/migrations/0003_auto_20170411_0504.py
@@ -1,7 +1,4 @@
# -*- coding: utf-8 -*-
-# Generated by Django 1.11 on 2017-04-11 05:04
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/mezzanine/blog/models.py b/mezzanine/blog/models.py
index 9bac43a4d4..67838acc67 100644
--- a/mezzanine/blog/models.py
+++ b/mezzanine/blog/models.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-from future.builtins import str
-
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
diff --git a/mezzanine/blog/templates/blog/blog_post_detail.html b/mezzanine/blog/templates/blog/blog_post_detail.html
index 24efbd2424..200582275a 100644
--- a/mezzanine/blog/templates/blog/blog_post_detail.html
+++ b/mezzanine/blog/templates/blog/blog_post_detail.html
@@ -18,7 +18,7 @@
{% block breadcrumb_menu %}
{{ block.super }}
-
{{ blog_post.title }}
+{{ blog_post.title }}
{% endblock %}
{% block main %}
diff --git a/mezzanine/blog/templates/blog/blog_post_list.html b/mezzanine/blog/templates/blog/blog_post_list.html
index 8ec0f9584f..32b88a508e 100644
--- a/mezzanine/blog/templates/blog/blog_post_list.html
+++ b/mezzanine/blog/templates/blog/blog_post_list.html
@@ -26,7 +26,7 @@
{% block breadcrumb_menu %}
{{ block.super }}
{% if tag or category or year or month or author %}
-{% spaceless %}
+{% spaceless %}
{% if tag %}
{% trans "Tag:" %} {{ tag }}
{% else %}{% if category %}
diff --git a/mezzanine/blog/templatetags/blog_tags.py b/mezzanine/blog/templatetags/blog_tags.py
index 8d352536e9..5e193dbc28 100644
--- a/mezzanine/blog/templatetags/blog_tags.py
+++ b/mezzanine/blog/templatetags/blog_tags.py
@@ -1,4 +1,3 @@
-from __future__ import unicode_literals
from datetime import datetime
from django.contrib.auth import get_user_model
diff --git a/mezzanine/blog/tests.py b/mezzanine/blog/tests.py
index 33162d4ce9..6e89789c27 100644
--- a/mezzanine/blog/tests.py
+++ b/mezzanine/blog/tests.py
@@ -1,14 +1,9 @@
-from __future__ import unicode_literals
-
import re
import pytz
import datetime
from unittest import skipUnless
-try:
- from urllib.parse import urlparse
-except ImportError:
- from urlparse import urlparse
+from urllib.parse import urlparse
from django.urls import reverse
from django.template import Context, Template
diff --git a/mezzanine/blog/urls.py b/mezzanine/blog/urls.py
index 54d5d31fe7..84b238a0d6 100644
--- a/mezzanine/blog/urls.py
+++ b/mezzanine/blog/urls.py
@@ -1,6 +1,4 @@
-from __future__ import unicode_literals
-
-from django.conf.urls import url
+from django.urls import re_path
from mezzanine.blog import views
from mezzanine.conf import settings
@@ -11,32 +9,32 @@
# Blog patterns.
urlpatterns = [
- url(r"^feeds/(?P.*)%s$" % _slash,
+ re_path(r"^feeds/(?P.*)%s$" % _slash,
views.blog_post_feed, name="blog_post_feed"),
- url(r"^tag/(?P.*)/feeds/(?P.*)%s$" % _slash,
+ re_path(r"^tag/(?P.*)/feeds/(?P.*)%s$" % _slash,
views.blog_post_feed, name="blog_post_feed_tag"),
- url(r"^tag/(?P.*)%s$" % _slash,
+ re_path(r"^tag/(?P.*)%s$" % _slash,
views.blog_post_list, name="blog_post_list_tag"),
- url(r"^category/(?P.*)/feeds/(?P.*)%s$" % _slash,
+ re_path(r"^category/(?P.*)/feeds/(?P.*)%s$" % _slash,
views.blog_post_feed, name="blog_post_feed_category"),
- url(r"^category/(?P.*)%s$" % _slash,
+ re_path(r"^category/(?P.*)%s$" % _slash,
views.blog_post_list, name="blog_post_list_category"),
- url(r"^author/(?P.*)/feeds/(?P.*)%s$" % _slash,
+ re_path(r"^author/(?P.*)/feeds/(?P.*)%s$" % _slash,
views.blog_post_feed, name="blog_post_feed_author"),
- url(r"^author/(?P.*)%s$" % _slash,
+ re_path(r"^author/(?P.*)%s$" % _slash,
views.blog_post_list, name="blog_post_list_author"),
- url(r"^archive/(?P\d{4})/(?P\d{1,2})%s$" % _slash,
+ re_path(r"^archive/(?P\d{4})/(?P\d{1,2})%s$" % _slash,
views.blog_post_list, name="blog_post_list_month"),
- url(r"^archive/(?P\d{4})%s$" % _slash,
+ re_path(r"^archive/(?P\d{4})%s$" % _slash,
views.blog_post_list, name="blog_post_list_year"),
- url(r"^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/"
+ re_path(r"^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/"
"(?P.*)%s$" % _slash,
views.blog_post_detail, name="blog_post_detail_day"),
- url(r"^(?P\d{4})/(?P\d{1,2})/(?P.*)%s$" % _slash,
+ re_path(r"^(?P\d{4})/(?P\d{1,2})/(?P.*)%s$" % _slash,
views.blog_post_detail, name="blog_post_detail_month"),
- url(r"^(?P\d{4})/(?P.*)%s$" % _slash,
+ re_path(r"^(?P\d{4})/(?P.*)%s$" % _slash,
views.blog_post_detail, name="blog_post_detail_year"),
- url(r"^(?P.*)%s$" % _slash,
+ re_path(r"^(?P.*)%s$" % _slash,
views.blog_post_detail, name="blog_post_detail"),
- url(r"^$", views.blog_post_list, name="blog_post_list"),
+ re_path(r"^$", views.blog_post_list, name="blog_post_list"),
]
diff --git a/mezzanine/blog/views.py b/mezzanine/blog/views.py
index 3e41361e9f..825a8e30f5 100644
--- a/mezzanine/blog/views.py
+++ b/mezzanine/blog/views.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-from future.builtins import str, int
-
from calendar import month_name
from django.contrib.auth import get_user_model
diff --git a/mezzanine/boot/__init__.py b/mezzanine/boot/__init__.py
index 119f49a2b0..2770d1127e 100644
--- a/mezzanine/boot/__init__.py
+++ b/mezzanine/boot/__init__.py
@@ -8,8 +8,6 @@
custom fields not being available when custom admin classes are
registered.
"""
-from __future__ import unicode_literals
-
from collections import defaultdict
from django import VERSION as DJANGO_VERSION
diff --git a/mezzanine/conf/admin.py b/mezzanine/conf/admin.py
index a4648854eb..c7dbc8c134 100644
--- a/mezzanine/conf/admin.py
+++ b/mezzanine/conf/admin.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-from future.builtins import str
-
from copy import copy
from django.contrib import admin
diff --git a/mezzanine/conf/forms.py b/mezzanine/conf/forms.py
index 6cf6bd8bcf..df225eeb5f 100644
--- a/mezzanine/conf/forms.py
+++ b/mezzanine/conf/forms.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-from future.builtins import int
-
from collections import defaultdict
from django import forms
diff --git a/mezzanine/conf/models.py b/mezzanine/conf/models.py
index c542a7c30f..e46b7a20ae 100644
--- a/mezzanine/conf/models.py
+++ b/mezzanine/conf/models.py
@@ -1,13 +1,9 @@
-from __future__ import unicode_literals
-
from django.db import models
from django.utils.translation import ugettext_lazy as _
-from django.utils.encoding import python_2_unicode_compatible
from mezzanine.core.models import SiteRelated
-@python_2_unicode_compatible
class Setting(SiteRelated):
"""
Stores values for ``mezzanine.conf`` that can be edited via the admin.
diff --git a/mezzanine/conf/tests.py b/mezzanine/conf/tests.py
index 49a7c8b612..65bb5318ad 100644
--- a/mezzanine/conf/tests.py
+++ b/mezzanine/conf/tests.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-from future.builtins import bytes, str
-
import sys
from unittest import skipUnless
import warnings
diff --git a/mezzanine/core/__init__.py b/mezzanine/core/__init__.py
index 363b5bffe2..e3c653ca3c 100644
--- a/mezzanine/core/__init__.py
+++ b/mezzanine/core/__init__.py
@@ -2,8 +2,6 @@
Provides abstract models and admin features used throughout the various
Mezzanine apps.
"""
-from __future__ import unicode_literals
-
from mezzanine import __version__ # noqa
diff --git a/mezzanine/core/admin.py b/mezzanine/core/admin.py
index 9892bd67f5..f3f685d0a9 100644
--- a/mezzanine/core/admin.py
+++ b/mezzanine/core/admin.py
@@ -36,8 +36,8 @@ class BaseTranslationModelAdmin(TranslationAdmin):
"""
class Media:
js = (
+ 'admin/js/jquery.init.js',
static("modeltranslation/js/force_jquery.js"),
- static("mezzanine/js/%s" % settings.JQUERY_UI_FILENAME),
static("mezzanine/js/admin/tabbed_translation_fields.js"),
)
css = {
@@ -301,7 +301,8 @@ def __init__(self, *args, **kwargs):
self.model._meta.many_to_many)
for field in reversed(fields):
if field.name not in exclude_fields and field.editable:
- if not hasattr(field, "translated_field"):
+ if not hasattr(field, "translated_field") and field.name \
+ not in self.fieldsets[0][1]["fields"]:
self.fieldsets[0][1]["fields"].insert(3, field.name)
@property
diff --git a/mezzanine/core/apps.py b/mezzanine/core/apps.py
index b2b7c18b1d..2c2f255d71 100644
--- a/mezzanine/core/apps.py
+++ b/mezzanine/core/apps.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django import VERSION as DJANGO_VERSION
from django.apps import AppConfig
diff --git a/mezzanine/core/auth_backends.py b/mezzanine/core/auth_backends.py
index 4845caf45e..e4eee84619 100644
--- a/mezzanine/core/auth_backends.py
+++ b/mezzanine/core/auth_backends.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.tokens import default_token_generator
diff --git a/mezzanine/core/checks.py b/mezzanine/core/checks.py
index ff83ca27b7..d304f36a31 100644
--- a/mezzanine/core/checks.py
+++ b/mezzanine/core/checks.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import pprint
from django import VERSION as DJANGO_VERSION
diff --git a/mezzanine/core/defaults.py b/mezzanine/core/defaults.py
index 3b7f6921ff..d0d6fd20e8 100644
--- a/mezzanine/core/defaults.py
+++ b/mezzanine/core/defaults.py
@@ -9,8 +9,6 @@
that are only read during startup shouldn't be editable, since changing
them would require an application reload.
"""
-from __future__ import unicode_literals
-
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
@@ -174,7 +172,7 @@
description=_("Name of the jQuery file found in "
"mezzanine/core/static/mezzanine/js/"),
editable=False,
- default="jquery-1.8.3.min.js",
+ default="jquery-1.12.4.js",
)
register_setting(
@@ -183,7 +181,7 @@
description=_("Name of the jQuery UI file found in "
"mezzanine/core/static/mezzanine/js/"),
editable=False,
- default="jquery-ui-1.8.24.min.js",
+ default="jquery-ui-1.12.1.js",
)
register_setting(
diff --git a/mezzanine/core/exceptions.py b/mezzanine/core/exceptions.py
index ea56c29dcc..4d81531e06 100644
--- a/mezzanine/core/exceptions.py
+++ b/mezzanine/core/exceptions.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-
-
class FileSystemEncodingChanged(RuntimeError):
def __init__(self):
msg = ("Access was attempted on a file that contains unicode "
diff --git a/mezzanine/core/fields.py b/mezzanine/core/fields.py
index 8877472ab3..744903713d 100644
--- a/mezzanine/core/fields.py
+++ b/mezzanine/core/fields.py
@@ -1,6 +1,3 @@
-from __future__ import unicode_literals
-from future.builtins import str
-
from django.conf import settings
from django.contrib.admin.widgets import AdminTextareaWidget
from django.core.exceptions import ImproperlyConfigured, ValidationError
diff --git a/mezzanine/core/forms.py b/mezzanine/core/forms.py
index 3bc03e2127..65bf3756ba 100644
--- a/mezzanine/core/forms.py
+++ b/mezzanine/core/forms.py
@@ -1,15 +1,8 @@
-from __future__ import unicode_literals
-from future.builtins import str
-
from datetime import datetime
from uuid import uuid4
from django import forms
-try:
- from django.forms.widgets import SelectDateWidget
-except ImportError:
- # Django 1.8
- from django.forms.extras.widgets import SelectDateWidget
+from django.forms.widgets import SelectDateWidget
from django.forms.utils import to_current_timezone
from django.utils.safestring import mark_safe
@@ -50,16 +43,28 @@ class TinyMceWidget(forms.Textarea):
use TinyMCE.
"""
- class Media:
- js = [static("mezzanine/tinymce/tinymce.min.js"),
- static("mezzanine/tinymce/jquery.tinymce.min.js"),
- static(settings.TINYMCE_SETUP_JS)]
+ @property
+ def media(self):
+ extra = '' if settings.DEBUG else '.min'
+ js = [
+ 'admin/js/vendor/jquery/jquery%s.js' % extra,
+ 'admin/js/jquery.init.js',
+ static("mezzanine/tinymce/tinymce.min.js"),
+ static("mezzanine/tinymce/jquery.tinymce.min.js"),
+ static(settings.TINYMCE_SETUP_JS),
+ ]
css = {'all': [static("mezzanine/tinymce/tinymce.css")]}
+ return forms.Media(js=js, css=css)
def __init__(self, *args, **kwargs):
super(TinyMceWidget, self).__init__(*args, **kwargs)
self.attrs["class"] = "mceEditor"
+ def use_required_attribute(self, initial):
+ # TinyMCE does not put content back into the