diff options
author | Masco Kaliyamoorthy <masco.kaliyamoorthy@enovance.com> | 2015-08-13 13:31:32 +0530 |
---|---|---|
committer | Matthias Runge <mrunge@redhat.com> | 2015-09-04 18:39:15 +0000 |
commit | 4e8549ee9a21ea8a2f44c8607b0abaf1a63f66a3 (patch) | |
tree | a7582d1e7f3007a46470ecdbee431147d855746c /horizon/templatetags | |
parent | 3915c85565f7d16f7b47d25dc070769642e30593 (diff) | |
download | horizon-4e8549ee9a21ea8a2f44c8607b0abaf1a63f66a3.tar.gz |
Replace SortedDict with OrderedDict
From django V1.9 django.utils.datastructures.SortedDict
will be removed and it is deprecated in V1.7.
The similar functionality is added in collections.OrderedDict
from python 2.7.
Horizon code also should avoid the SortedDict class and
start using the OrderedDict class.
This patch replacing the SortedDict with OrderedDict.
Change-Id: I8dfcf7c29fc49b6215451f160cf7a951bf11b5ad
Closes-Bug: #1492270
Diffstat (limited to 'horizon/templatetags')
-rw-r--r-- | horizon/templatetags/horizon.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/horizon/templatetags/horizon.py b/horizon/templatetags/horizon.py index da4501a12..c8ef4f112 100644 --- a/horizon/templatetags/horizon.py +++ b/horizon/templatetags/horizon.py @@ -14,11 +14,11 @@ from __future__ import absolute_import +from collections import OrderedDict from horizon.contrib import bootstrap_datepicker from django.conf import settings from django import template -from django.utils.datastructures import SortedDict from django.utils.encoding import force_text from django.utils import translation from django.utils.translation import ugettext_lazy as _ @@ -70,10 +70,10 @@ def horizon_nav(context): non_empty_groups.append((group, allowed_panels)) if (callable(dash.nav) and dash.nav(context) and dash.can_access(context)): - dashboards.append((dash, SortedDict(non_empty_groups))) + dashboards.append((dash, OrderedDict(non_empty_groups))) elif (not callable(dash.nav) and dash.nav and dash.can_access(context)): - dashboards.append((dash, SortedDict(non_empty_groups))) + dashboards.append((dash, OrderedDict(non_empty_groups))) return {'components': dashboards, 'user': context['request'].user, 'current': current_dashboard, @@ -125,7 +125,7 @@ def horizon_dashboard_nav(context): else: non_empty_groups.append((group.name, allowed_panels)) - return {'components': SortedDict(non_empty_groups), + return {'components': OrderedDict(non_empty_groups), 'user': context['request'].user, 'current': context['request'].horizon['panel'].slug, 'request': context['request']} |