2
2
from appconf import AppConf
3
3
from django .conf import settings # NOQA
4
4
5
- __all__ = (' settings' , ' Select2Conf' )
5
+ __all__ = (" settings" , " Select2Conf" )
6
6
7
7
8
8
class Select2Conf (AppConf ):
9
9
"""Settings for Django-Select2."""
10
10
11
- LIB_VERSION = ' 4.0.12'
11
+ LIB_VERSION = " 4.0.12"
12
12
"""Version of the Select2 library."""
13
13
14
- CACHE_BACKEND = ' default'
14
+ CACHE_BACKEND = " default"
15
15
"""
16
16
Django-Select2 uses Django's cache to sure a consistent state across multiple machines.
17
17
@@ -49,14 +49,16 @@ class Select2Conf(AppConf):
49
49
how long a browser session can last.
50
50
Once widget is dropped from the cache the json response view will return a 404.
51
51
"""
52
- CACHE_PREFIX = ' select2_'
52
+ CACHE_PREFIX = " select2_"
53
53
"""
54
54
If you caching backend does not support multiple databases
55
55
you can isolate select2 using the cache prefix setting.
56
56
It has set `select2_` as a default value, which you can change if needed.
57
57
"""
58
58
59
- JS = 'https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/select2.min.js' .format (version = LIB_VERSION )
59
+ JS = "https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/select2.min.js" .format (
60
+ version = LIB_VERSION
61
+ )
60
62
"""
61
63
The URI for the Select2 JS file. By default this points to the Cloudflare CDN.
62
64
@@ -74,7 +76,9 @@ class Select2Conf(AppConf):
74
76
develop without an Internet connection.
75
77
"""
76
78
77
- CSS = 'https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/css/select2.min.css' .format (version = LIB_VERSION )
79
+ CSS = "https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/css/select2.min.css" .format (
80
+ version = LIB_VERSION
81
+ )
78
82
"""
79
83
The URI for the Select2 CSS file. By default this points to the Cloudflare CDN.
80
84
@@ -92,7 +96,9 @@ class Select2Conf(AppConf):
92
96
develop without an Internet connection.
93
97
"""
94
98
95
- I18N_PATH = 'https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/i18n' .format (version = LIB_VERSION )
99
+ I18N_PATH = "https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/i18n" .format (
100
+ version = LIB_VERSION
101
+ )
96
102
"""
97
103
The base URI for the Select2 i18n files. By default this points to the Cloudflare CDN.
98
104
@@ -106,53 +112,53 @@ class Select2Conf(AppConf):
106
112
"""
107
113
108
114
I18N_AVAILABLE_LANGUAGES = [
109
- 'ar' ,
110
- 'az' ,
111
- 'bg' ,
112
- 'ca' ,
113
- 'cs' ,
114
- 'da' ,
115
- 'de' ,
116
- 'el' ,
117
- 'en' ,
118
- 'es' ,
119
- 'et' ,
120
- 'eu' ,
121
- 'fa' ,
122
- 'fi' ,
123
- 'fr' ,
124
- 'gl' ,
125
- 'he' ,
126
- 'hi' ,
127
- 'hr' ,
128
- 'hu' ,
129
- 'id' ,
130
- 'is' ,
131
- 'it' ,
132
- 'ja' ,
133
- 'km' ,
134
- 'ko' ,
135
- 'lt' ,
136
- 'lv' ,
137
- 'mk' ,
138
- 'ms' ,
139
- 'nb' ,
140
- 'nl' ,
141
- 'pl' ,
142
- ' pt-BR' ,
143
- 'pt' ,
144
- 'ro' ,
145
- 'ru' ,
146
- 'sk' ,
147
- ' sr-Cyrl' ,
148
- 'sr' ,
149
- 'sv' ,
150
- 'th' ,
151
- 'tr' ,
152
- 'uk' ,
153
- 'vi' ,
154
- ' zh-CN' ,
155
- ' zh-TW' ,
115
+ "ar" ,
116
+ "az" ,
117
+ "bg" ,
118
+ "ca" ,
119
+ "cs" ,
120
+ "da" ,
121
+ "de" ,
122
+ "el" ,
123
+ "en" ,
124
+ "es" ,
125
+ "et" ,
126
+ "eu" ,
127
+ "fa" ,
128
+ "fi" ,
129
+ "fr" ,
130
+ "gl" ,
131
+ "he" ,
132
+ "hi" ,
133
+ "hr" ,
134
+ "hu" ,
135
+ "id" ,
136
+ "is" ,
137
+ "it" ,
138
+ "ja" ,
139
+ "km" ,
140
+ "ko" ,
141
+ "lt" ,
142
+ "lv" ,
143
+ "mk" ,
144
+ "ms" ,
145
+ "nb" ,
146
+ "nl" ,
147
+ "pl" ,
148
+ " pt-BR" ,
149
+ "pt" ,
150
+ "ro" ,
151
+ "ru" ,
152
+ "sk" ,
153
+ " sr-Cyrl" ,
154
+ "sr" ,
155
+ "sv" ,
156
+ "th" ,
157
+ "tr" ,
158
+ "uk" ,
159
+ "vi" ,
160
+ " zh-CN" ,
161
+ " zh-TW" ,
156
162
]
157
163
"""
158
164
List of available translations.
@@ -177,4 +183,4 @@ class Select2Conf(AppConf):
177
183
class Meta :
178
184
"""Prefix for all Django-Select2 settings."""
179
185
180
- prefix = ' SELECT2'
186
+ prefix = " SELECT2"
0 commit comments