1
1
import json
2
+ from urllib .request import urlopen
3
+ from urllib .error import HTTPError
2
4
from django .conf import settings
3
5
from django .core .cache import cache
4
6
from django .db import models
5
- from django .utils .six import python_2_unicode_compatible
6
7
from django .utils .functional import cached_property
7
8
from django .utils .translation import ugettext_lazy as _
8
9
from fluent_contents .extensions import PluginImageField , PluginHtmlField , PluginUrlField
9
10
from fluent_contents .models import ContentItem
10
11
11
- try :
12
- # Python 3
13
- from urllib .request import urlopen
14
- from urllib .error import HTTPError
15
- except ImportError :
16
- from urllib2 import urlopen , HTTPError # Python 2
17
12
18
-
19
- @python_2_unicode_compatible
20
13
class Col12Item (ContentItem ):
21
14
"""
22
15
A column that takes 1/2 of the width
@@ -33,7 +26,6 @@ def __str__(self):
33
26
return self .title
34
27
35
28
36
- @python_2_unicode_compatible
37
29
class ContentBoxItem (ContentItem ):
38
30
"""
39
31
The context box includes a divider.
@@ -46,7 +38,6 @@ def __str__(self):
46
38
return u'splitter'
47
39
48
40
49
- @python_2_unicode_compatible
50
41
class ImageTextItem (ContentItem ):
51
42
"""
52
43
A block with image + text
@@ -81,7 +72,6 @@ def image_css_class(self):
81
72
return 'image_fl'
82
73
83
74
84
- @python_2_unicode_compatible
85
75
class PackageItem (ContentItem ):
86
76
"""
87
77
An item on the page that describes a Python package.
0 commit comments