Ticket #11252: django_admin_pagination_fixamperstands.patch
File django_admin_pagination_fixamperstands.patch, 1.2 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/templatetags/admin_list.py
4 4 from django.core.exceptions import ObjectDoesNotExist 5 5 from django.db import models 6 6 from django.utils import dateformat 7 from django.utils.html import escape, conditional_escape 7 from django.utils.html import escape, conditional_escape, fix_ampersands 8 8 from django.utils.text import capfirst 9 9 from django.utils.safestring import mark_safe 10 10 from django.utils.translation import get_date_formats, get_partial_date_formats, ugettext as _ … … 22 22 elif i == cl.page_num: 23 23 return mark_safe(u'<span class="this-page">%d</span> ' % (i+1)) 24 24 else: 25 return mark_safe(u'<a href="%s"%s>%d</a> ' % ( cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.num_pages-1 and ' class="end"' or ''), i+1))25 return mark_safe(u'<a href="%s"%s>%d</a> ' % (fix_ampersands(cl.get_query_string({PAGE_VAR: i})), (i == cl.paginator.num_pages-1 and ' class="end"' or ''), i+1)) 26 26 paginator_number = register.simple_tag(paginator_number) 27 27 28 28 def pagination(cl):