Cleanup compatibility shims
This commit is contained in:
parent
bdfbfc438a
commit
497ec74f2e
4 changed files with 9 additions and 12 deletions
|
@ -24,12 +24,6 @@ from .forms import CategoryAdminForm, PostAdminForm
|
||||||
from .models import BlogCategory, Post
|
from .models import BlogCategory, Post
|
||||||
from .settings import get_setting
|
from .settings import get_setting
|
||||||
|
|
||||||
try:
|
|
||||||
from admin_enhancer.admin import EnhancedModelAdminMixin
|
|
||||||
except ImportError:
|
|
||||||
class EnhancedModelAdminMixin(object):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class SiteListFilter(admin.SimpleListFilter):
|
class SiteListFilter(admin.SimpleListFilter):
|
||||||
title = _('site')
|
title = _('site')
|
||||||
|
@ -55,7 +49,7 @@ class SiteListFilter(admin.SimpleListFilter):
|
||||||
raise admin.options.IncorrectLookupParameters(e)
|
raise admin.options.IncorrectLookupParameters(e)
|
||||||
|
|
||||||
|
|
||||||
class BlogCategoryAdmin(EnhancedModelAdminMixin, ModelAppHookConfig, TranslatableAdmin):
|
class BlogCategoryAdmin(ModelAppHookConfig, TranslatableAdmin):
|
||||||
form = CategoryAdminForm
|
form = CategoryAdminForm
|
||||||
list_display = [
|
list_display = [
|
||||||
'name', 'parent', 'app_config', 'all_languages_column',
|
'name', 'parent', 'app_config', 'all_languages_column',
|
||||||
|
|
|
@ -24,10 +24,10 @@ try:
|
||||||
import HTMLParser
|
import HTMLParser
|
||||||
|
|
||||||
h = HTMLParser.HTMLParser()
|
h = HTMLParser.HTMLParser()
|
||||||
except ImportError:
|
unescape = h.unescape
|
||||||
from html.parser import HTMLParser
|
|
||||||
|
|
||||||
h = HTMLParser()
|
except ImportError:
|
||||||
|
from html import unescape
|
||||||
|
|
||||||
|
|
||||||
class LatestEntriesFeed(Feed):
|
class LatestEntriesFeed(Feed):
|
||||||
|
@ -123,13 +123,13 @@ class FBInstantFeed(Rss201rev2Feed):
|
||||||
|
|
||||||
handler.startElement('description', {})
|
handler.startElement('description', {})
|
||||||
handler._write('<![CDATA[{0}]]>'.format(
|
handler._write('<![CDATA[{0}]]>'.format(
|
||||||
h.unescape(normalize_newlines(force_text(item['abstract'])).replace('\n', ' ')))
|
unescape(normalize_newlines(force_text(item['abstract'])).replace('\n', ' ')))
|
||||||
)
|
)
|
||||||
handler.endElement('description')
|
handler.endElement('description')
|
||||||
handler.startElement('content:encoded', {})
|
handler.startElement('content:encoded', {})
|
||||||
handler._write('<![CDATA[')
|
handler._write('<![CDATA[')
|
||||||
handler._write('<!doctype html>')
|
handler._write('<!doctype html>')
|
||||||
handler._write(h.unescape(force_text(item['content'])))
|
handler._write(unescape(force_text(item['content'])))
|
||||||
handler._write(']]>')
|
handler._write(']]>')
|
||||||
handler.endElement('content:encoded')
|
handler.endElement('content:encoded')
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
from aldryn_search.helpers import get_plugin_index_data
|
from aldryn_search.helpers import get_plugin_index_data
|
||||||
from aldryn_search.utils import get_index_base, strip_tags
|
from aldryn_search.utils import get_index_base, strip_tags
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -60,6 +60,7 @@ setup(
|
||||||
'Framework :: Django',
|
'Framework :: Django',
|
||||||
'Framework :: Django :: 1.8',
|
'Framework :: Django :: 1.8',
|
||||||
'Framework :: Django :: 1.9',
|
'Framework :: Django :: 1.9',
|
||||||
|
'Framework :: Django :: 1.10',
|
||||||
'Programming Language :: Python :: 2',
|
'Programming Language :: Python :: 2',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 2.7',
|
||||||
'Programming Language :: Python :: 3',
|
'Programming Language :: Python :: 3',
|
||||||
|
|
Loading…
Reference in a new issue