Add from __future__ import unicode_literals, issue #37
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
object_navigation = {}
|
||||
model_list_columns = {}
|
||||
top_menu_entries = []
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import inspect
|
||||
import logging
|
||||
@@ -113,7 +113,7 @@ class Link(object):
|
||||
else:
|
||||
resolved_link.url = reverse(self.view, args=args)
|
||||
if self.keep_query:
|
||||
resolved_link.url = u'%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
resolved_link.url = '%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
|
||||
except NoReverseMatch, exc:
|
||||
resolved_link.url = '#'
|
||||
@@ -127,7 +127,7 @@ class Link(object):
|
||||
else:
|
||||
resolved_link.url = self.url % args
|
||||
if self.keep_query:
|
||||
resolved_link.url = u'%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
resolved_link.url = '%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
else:
|
||||
resolved_link.active = False
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
@@ -24,4 +26,4 @@ class MultiItemForm(forms.Form):
|
||||
else:
|
||||
self.fields['action'].choices = group
|
||||
|
||||
action = forms.ChoiceField(label=_(u'Actions'), required=False)
|
||||
action = forms.ChoiceField(label=_('Actions'), required=False)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
link_spacer = {'text': ('───────────────'), 'url': ''}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import copy
|
||||
import inspect
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import urlparse
|
||||
|
||||
@@ -22,7 +22,7 @@ def button_navigation_widget(request, link):
|
||||
Permission.objects.check_permissions(request.user, link['permissions'])
|
||||
return render_widget(request, link)
|
||||
except PermissionDenied:
|
||||
return u''
|
||||
return ''
|
||||
else:
|
||||
return render_widget(request, link)
|
||||
|
||||
@@ -40,7 +40,7 @@ def render_widget(request, link):
|
||||
links = resolve_links(context, [link], current_view, current_path, parsed_query_string)
|
||||
if links:
|
||||
link = links[0]
|
||||
return mark_safe(u'\
|
||||
return mark_safe('\
|
||||
<a class="pure-button mayan-button-big" href="%(url)s">\
|
||||
<p>\
|
||||
<img src="%(static_url)s"><br>\
|
||||
@@ -50,7 +50,7 @@ def render_widget(request, link):
|
||||
'url': reverse(link['view']) if 'view' in link else link['url'],
|
||||
'static_url': staticfiles_storage.url('main/icons/{0}'.format(link.get('icon', 'link_button.png'))),
|
||||
'string': link['text'],
|
||||
'image_alt': _(u'Icon'),
|
||||
'image_alt': _('Icon'),
|
||||
})
|
||||
else:
|
||||
return u''
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user