From f787e348df5aae0d53053b3e4cce3fb1ffbeccb2 Mon Sep 17 00:00:00 2001 From: lxf Date: Wed, 21 May 2014 18:21:03 +0000 Subject: additional fixes to run under python 3.2 --- app/lib/pagination/templatetags/pagination_tags.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/lib') diff --git a/app/lib/pagination/templatetags/pagination_tags.py b/app/lib/pagination/templatetags/pagination_tags.py index dd47009..75c23f6 100644 --- a/app/lib/pagination/templatetags/pagination_tags.py +++ b/app/lib/pagination/templatetags/pagination_tags.py @@ -50,17 +50,17 @@ def do_autopaginate(parser, token): try: paginate_by = int(split[2]) except ValueError: - raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[2]) + raise template.TemplateSyntaxError('Got %s, but expected integer.' % split[2]) return AutoPaginateNode(split[1], paginate_by=paginate_by) elif len(split) == 4: try: paginate_by = int(split[2]) except ValueError: - raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[2]) + raise template.TemplateSyntaxError('Got %s, but expected integer.' % split[2]) try: orphans = int(split[3]) except ValueError: - raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[3]) + raise template.TemplateSyntaxError('Got %s, but expected integer.' % split[3]) return AutoPaginateNode(split[1], paginate_by=paginate_by, orphans=orphans) else: raise template.TemplateSyntaxError('%r tag takes one required argument and one optional argument' % split[0]) @@ -105,7 +105,7 @@ class AutoPaginateNode(template.Node): try: model = value[0].__class__ except IndexError: - return u'' + return '' paginator_class = Paginator paginator = paginator_class(value, self.paginate_by, self.orphans) try: @@ -113,13 +113,13 @@ class AutoPaginateNode(template.Node): except InvalidPage: context[key] = [] context['invalid_page'] = True - return u'' + return '' context[key] = page_obj.object_list context['paginator'] = paginator context['page_obj'] = page_obj if hasattr(context['request'], 'page_url'): context['use_page_path'] = True - return u'' + return '' def paginate(context, window=DEFAULT_WINDOW): """ -- cgit v1.2.3-70-g09d2