fnp
/
fnpdjango.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.4.4: Django 3.0 support, actions.export_as_csv_action added.
[fnpdjango.git]
/
fnpdjango
/
templatetags
/
fnp_prevnext.py
diff --git
a/fnpdjango/templatetags/fnp_prevnext.py
b/fnpdjango/templatetags/fnp_prevnext.py
index
294cd12
..
cb4efe2
100644
(file)
--- a/
fnpdjango/templatetags/fnp_prevnext.py
+++ b/
fnpdjango/templatetags/fnp_prevnext.py
@@
-1,7
+1,12
@@
from copy import copy
from copy import copy
-from urllib import urlencode
from django.template import Library
from django.template import Library
+try:
+ from urllib.parse import urlencode
+except ImportError:
+ from urllib import urlencode
+
+
register = Library()
register = Library()
@@
-11,7
+16,6
@@
def previous_page(context, fallback=None, fallback_title=None):
if current > 1:
get_dict = copy(context['request'].GET)
get_dict['page'] = current - 1
if current > 1:
get_dict = copy(context['request'].GET)
get_dict['page'] = current - 1
- print get_dict
return {'number': current - 1, 'title': None, 'url': None,
'get_dict': urlencode(get_dict)}
else:
return {'number': current - 1, 'title': None, 'url': None,
'get_dict': urlencode(get_dict)}
else:
@@
-25,7
+29,6
@@
def next_page(context, fallback=None, fallback_title=None):
if current < page_range[-1]:
get_dict = copy(context['request'].GET)
get_dict['page'] = current + 1
if current < page_range[-1]:
get_dict = copy(context['request'].GET)
get_dict['page'] = current + 1
- print get_dict
return {'number': current + 1, 'title': None, 'url': None,
'get_dict': urlencode(get_dict)}
else:
return {'number': current + 1, 'title': None, 'url': None,
'get_dict': urlencode(get_dict)}
else: