55from django .template .defaultfilters import stringfilter
66from collections import namedtuple
77
8- try :
9- from django .utils .encoding import force_text
10- except ImportError :
11- from django .utils .encoding import force_unicode as force_text
8+ # try:
9+ # from django.utils.encoding import force_str
10+ # except ImportError:
11+ # from django.utils.encoding import force_unicode as force_str
12+ from django .utils .encoding import force_str
1213
1314register = template .Library ()
1415Field = namedtuple ('Field' , 'name verbose_name' )
@@ -147,7 +148,7 @@ def get_pagination_context(page, pages_to_show=11,
147148 # Append proper character to url
148149 if url :
149150 # Remove existing page GET parameters
150- url = force_text (url )
151+ url = force_str (url )
151152 url = re .sub (r'\?{0}\=[^\&]+' .format (parameter_name ), '?' , url )
152153 url = re .sub (r'\&{0}\=[^\&]+' .format (parameter_name ), '' , url )
153154 # Append proper separator
@@ -159,7 +160,7 @@ def get_pagination_context(page, pages_to_show=11,
159160 if extra :
160161 if not url :
161162 url = '?'
162- url += force_text (extra ) + '&'
163+ url += force_str (extra ) + '&'
163164 if url :
164165 url = url .replace ('?&' , '?' )
165166 # Set CSS classes, see http://getbootstrap.com/components/#pagination
0 commit comments