Add from __future__ import unicode_literals, issue #37
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from navigation.api import register_links
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
@@ -7,7 +7,7 @@ def is_superuser(context):
|
||||
return context['request'].user.is_staff or context['request'].user.is_superuser
|
||||
|
||||
|
||||
link_execute = {'text': _(u'Execute'), 'view': 'statistics:execute', 'args': 'object.id', 'famfam': 'lightning', 'condition': is_superuser}
|
||||
link_namespace_details = {'text': _(u'Details'), 'view': 'statistics:namespace_details', 'args': 'namespace.id', 'famfam': 'chart_curve_go', 'condition': is_superuser}
|
||||
link_namespace_list = {'text': _(u'Namespace list'), 'view': 'statistics:namespace_list', 'famfam': 'chart_curve', 'condition': is_superuser}
|
||||
link_statistics = {'text': _(u'Statistics'), 'view': 'statistics:namespace_list', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser}
|
||||
link_execute = {'text': _('Execute'), 'view': 'statistics:execute', 'args': 'object.id', 'famfam': 'lightning', 'condition': is_superuser}
|
||||
link_namespace_details = {'text': _('Details'), 'view': 'statistics:namespace_details', 'args': 'namespace.id', 'famfam': 'chart_curve_go', 'condition': is_superuser}
|
||||
link_namespace_list = {'text': _('Namespace list'), 'view': 'statistics:namespace_list', 'famfam': 'chart_curve', 'condition': is_superuser}
|
||||
link_statistics = {'text': _('Statistics'), 'view': 'statistics:namespace_list', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import patterns, url
|
||||
|
||||
urlpatterns = patterns('statistics.views',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.shortcuts import render_to_response
|
||||
@@ -15,7 +15,7 @@ def namespace_list(request):
|
||||
return render_to_response('main/generic_list.html', {
|
||||
'object_list': StatisticNamespace.get_all(),
|
||||
'hide_link': True,
|
||||
'title': _(u'Statistics namespaces'),
|
||||
'title': _('Statistics namespaces'),
|
||||
'list_object_variable_name': 'namespace',
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@@ -31,7 +31,7 @@ def namespace_details(request, namespace_id):
|
||||
'namespace': namespace,
|
||||
'object_list': namespace.statistics,
|
||||
'hide_link': True,
|
||||
'title': _(u'Namespace details for: %s') % namespace,
|
||||
'title': _('Namespace details for: %s') % namespace,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -45,10 +45,10 @@ def execute(request, statistic_id):
|
||||
'object': statictic,
|
||||
'namespace': statictic.namespace,
|
||||
'navigation_object_list': [
|
||||
{'object': 'namespace', 'name': _(u'Namespace')},
|
||||
{'object': 'object', 'name': _(u'Statistic')},
|
||||
{'object': 'namespace', 'name': _('Namespace')},
|
||||
{'object': 'object', 'name': _('Statistic')},
|
||||
],
|
||||
'object_list': statictic.get_results(),
|
||||
'hide_link': True,
|
||||
'title': _(u'Results for: %s') % statictic,
|
||||
'title': _('Results for: %s') % statictic,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
Reference in New Issue
Block a user