Drop Django 1.7 support

Django 1.7 support ends in December 2015
(https://www.djangoproject.com/download/#supported-versions), so it
will not be supported by Mitaka release.

This patch removes many of the deprecation warnings:-

`RedirectView.permanent` change:
https://docs.djangoproject.com/en/1.8/ref/class-based-views/base/

`url` change:
https://docs.djangoproject.com/en/1.8/internals/deprecation/
See version 1.5 notes for the url and ssi template tag change

`django.forms.utils` change:
https://docs.djangoproject.com/en/1.8/internals/deprecation/
See version 1.9 notes

`firstof` change:
https://docs.djangoproject.com/en/1.8/internals/deprecation/
See version 1.8 notes for cycle and firstof template tags

Change-Id: If546c087e73d189daa92e5bd63f0533fcf19089f
Partially-Implements: blueprint drop-dj17
This commit is contained in:
Rob Cresswell 2015-09-14 14:24:47 +01:00
parent 9547fc3e3d
commit f2b2289b4a
95 changed files with 13 additions and 108 deletions

View File

@ -20,7 +20,7 @@ import six
from django.core.exceptions import ValidationError # noqa
from django.core import urlresolvers
from django.forms import fields
from django.forms.util import flatatt # noqa
from django.forms.utils import flatatt # noqa
from django.forms import widgets
from django.utils.encoding import force_text
from django.utils.functional import Promise # noqa

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}{% trans "Log In" %}{% endblock %}
{% block modal_class %}login {% if hide %}modal{% endif %}{% endblock %}

View File

@ -1,3 +1,2 @@
{% load url from future %}
{% comment %} Django's JavaScript i18n Implementation {% endcomment %}
<script type="text/javascript" src="{% url 'horizon:jsi18n' 'horizon' %}"></script>

View File

@ -1,5 +1,4 @@
{% load horizon i18n %}
{% load url from future %}
<ul id="sidebar-accordion" class="nav nav-pills nav-stacked">
{% for dashboard, panel_info in components %}

View File

@ -1,4 +1,3 @@
{% load url from future %}
{% load i18n %}
{% with subfolders=breadcrumb.get_subfolders %}
<ul class="breadcrumb">

View File

@ -1,5 +1,4 @@
{% load i18n %}
{% load cycle from future %}
{% with table.needs_form_wrapper as needs_form_wrapper %}
<div class="table_wrapper">
{% if needs_form_wrapper %}<form action="{{ table.get_full_url }}" method="POST">{% csrf_token %}{% endif %}

View File

@ -1,4 +1,3 @@
{% load url from future %}
{% if regions.support %}
<a href="#" class="dropdown-toggle" role="button" aria-expanded="false">
{{ regions.current.name }}

View File

@ -1,5 +1,4 @@
{% load branding horizon i18n %}
{% load url from future %}
<div id='sidebar'>
{% horizon_nav %}

View File

@ -1,4 +1,3 @@
{% load url from future %}
<!DOCTYPE html>
<html>
<head>

View File

@ -12,7 +12,7 @@
import copy
from django.forms.util import flatatt # noqa
from django.forms.utils import flatatt # noqa
class HTMLElement(object):

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
{% for node_group in template.node_groups %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}
@ -21,4 +20,4 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" id="upload_file_btn" type="submit" value="{% trans "Upload" %}"/>
<a href="{% url 'horizon:project:data_processing.cluster_templates:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
{% for node_group in cluster.node_groups %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}
@ -26,4 +25,4 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" id="edit_image_tags_btn" type="submit" value="{% trans "Done" %}"/>
<a href="{% url 'horizon:project:data_processing.data_image_registry:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}
@ -24,4 +23,4 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" id="edit_image_tags_btn" type="submit" value="{% trans "Done" %}"/>
<a href="{% url 'horizon:project:data_processing.data_image_registry:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}

View File

@ -1,5 +1,5 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">
<dt>{% trans "Status" %}</dt>

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}
@ -28,4 +27,4 @@
type="submit" value="{% trans "Select" %}"/>
<a href="{% url 'horizon:project:data_processing.wizard:jobex_guide' %}"
class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load url from future %}
{% load i18n %}
@ -28,4 +27,4 @@
type="submit" value="{% trans "Select" %}"/>
<a href="{% url 'horizon:project:data_processing.wizard:cluster_guide' %}"
class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block main %}

View File

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block main %}

View File

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block main %}

View File

@ -50,6 +50,7 @@ class ClusterGuideView(horizon_views.APIView):
class ResetClusterGuideView(generic.RedirectView):
pattern_name = 'horizon:project:data_processing.wizard:cluster_guide'
permanent = True
def get(self, request, *args, **kwargs):
if kwargs["reset_cluster_guide"]:
@ -74,6 +75,7 @@ class JobExecutionGuideView(horizon_views.APIView):
class ResetJobExGuideView(generic.RedirectView):
pattern_name = 'horizon:project:data_processing.wizard:jobex_guide'
permanent = True
def get(self, request, *args, **kwargs):
if kwargs["reset_jobex_guide"]:

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}resize_instance_form{% endblock %}
{% block form_action %}{% url "horizon:project:databases:resize_instance" instance_id %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}resize_volume_form{% endblock %}
{% block form_action %}{% url "horizon:project:databases:resize_volume" instance_id %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}edit_aggregate_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:aggregates:update' id %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}disable_service_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:hypervisors:compute:disable_service' compute_host %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}evacuate_host_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:hypervisors:compute:evacuate_host' compute_host %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}evacuate_host_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:hypervisors:compute:migrate_host' compute_host %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}live_migrate_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:instances:live_migrate' instance_id %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_metadata_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:metadata_defs:create' %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends 'admin/metadata_defs/resource_types.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}
{% trans "Namespace Resource Type Associations" %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_usage_report_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:metering:create' %}{% endblock %}

View File

@ -1,5 +1,4 @@
{% load i18n %}
{% load url from future %}
<div id="samples_url" url="{% url "horizon:admin:metering:samples" %}"></div>
<div id="ceilometer-stats">

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_network_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:networks:create' %}{% endblock %}

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<h3>{% trans "Volume Snapshot Overview" %}</h3>

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:volumes:volume_types:update_type' volume_type.id %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% load url from future %}
{% block modal_id %}extra_specs_modal{% endblock %}
{% block modal-header %}{% trans "Volume Type Extra Specs" %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% load url from future %}
{% block modal_id %}qos_specs_modal{% endblock %}
@ -12,4 +11,4 @@
{% block modal-footer %}
<a href="{% url 'horizon:admin:volumes:volume_types_tab' %}" class="btn btn-default secondary cancel close">{% trans "Close" %}</a>
{% endblock %}
{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form_add_members.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}{% trans "Add Group Assignment" %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}{% trans "User Credentials" %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% blocktrans %}Download Key Pair{% endblocktrans %}{% endblock %}
{% block main %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}{% trans "Container Details" %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}copy_object_form{% endblock %}
{% block form_action %}{% url 'horizon:project:containers:object_copy' container_name object_name %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_container_form{% endblock %}
{% block form_action %}{% url 'horizon:project:containers:create' %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_directory_form{% endblock %}
{% block form_action %}{% url 'horizon:project:containers:create_pseudo_folder' container_name %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}{% trans "Object Details" %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_object_form{% endblock %}
{% block ng_controller %}DummyController{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}upload_object_form{% endblock %}
{% block form_name %}uploadForm{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans "Containers" %}{% endblock %}

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}password_instance_form{% endblock %}

View File

@ -1,5 +1,4 @@
{% load i18n %}
{% load url from future %}
<h3>{% trans "Instance Console" %}</h3>
{% if console_url %}

View File

@ -1,5 +1,4 @@
{% load i18n %}
{% load url from future %}
<div class="clearfix">
<h3 class="pull-left">{% trans "Instance Console Log" %}</h3>

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}rebuild_instance_form{% endblock %}
{% block form_action %}{% url "horizon:project:instances:rebuild" instance_id %}{% endblock %}

View File

@ -1,5 +1,4 @@
{% load i18n %}
{% load url from future %}
<!DOCTYPE html>
<html>
<head>
@ -22,4 +21,4 @@
{% endif %}
</body>
</html>
</html>

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n horizon humanize %}
{% load url from future %}
{% block form_id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:network_topology:createrouter' %}?{{ request.GET.urlencode }}{% endblock %}

View File

@ -1,5 +1,3 @@
{% load firstof from future %}
<!DOCTYPE html>
<html>
<head>

View File

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans "Network Topology" %}{% endblock %}
{% block main %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_network_form{% endblock %}
{% block form_action %}{% url 'horizon:project:networks:create' %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends 'horizon/common/_workflow.html' %}
{% load i18n %}
{% load url from future %}
{% block modal-footer %}
{% if workflow.wizard %}

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}add_routerroute_form{% endblock %}
{% block form_action %}{% url 'horizon:project:routers:addrouterroute' router.id %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}add_routerrule_form{% endblock %}
{% block form_action %}{% url 'horizon:project:routers:addrouterrule' router.id %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}add_interface_form{% endblock %}
{% block form_action %}{% url form_url router.id %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}setgateway_form{% endblock %}
{% block form_action %}{% url 'horizon:project:routers:setgateway' router.id %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}{% trans "Stack Preview" %}{% endblock %}

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_class %}{{ block.super }} horizontal {% if show_attach %}split_half{% else %} no_split{% endif %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-body-right %}
<div class="quota-dynamic">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,5 +1,4 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<div class="detail">
<dl class="dl-horizontal">

View File

@ -1,6 +1,5 @@
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block title %} - {% trans "Forbidden" %}{% endblock %}

View File

@ -1,6 +1,5 @@
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block title %} - {% trans "Page Not Found" %}{% endblock %}

View File

@ -1,5 +1,4 @@
{% load branding i18n %}
{% load url from future %}
{% load context_selection %}
<nav class="navbar navbar-default">

View File

@ -1,5 +1,4 @@
{% load i18n %}
{% load url from future %}
{% with dashboard_url=request.horizon.dashboard.get_absolute_url %}
<ul>

View File

@ -1,5 +1,4 @@
{% load i18n %}
{% load url from future %}
{% with panel_url=request.horizon.panel.get_absolute_url %}
<ul>

View File

@ -1,3 +1,2 @@
{% load url from future %}
{% comment %} Django's JavaScript i18n Implementation {% endcomment %}
<script type="text/javascript" src="{% url 'horizon:jsi18n' 'horizon+openstack_dashboard' %}"></script>

View File

@ -1,6 +1,4 @@
{% load compress %}
{% load url from future %}
{% load firstof from future %}
{% load datepicker_locale from horizon %}
{% datepicker_locale as DATEPICKER_LOCALE %}

View File

@ -1,5 +1,4 @@
{% load branding i18n %}
{% load url from future %}
{% load context_selection %}
{% load compress %}

View File

@ -1,5 +1,4 @@
{% load horizon i18n %}
{% load url from future %}
<div class="sidebar-wrapper">
<ul id="sidebar-drawer" class="nav nav-pills nav-stacked">

View File

@ -1,5 +1,5 @@
[tox]
envlist = py27,py27dj17,py27dj18,pep8,py34,releasenotes
envlist = py27,py27dj18,pep8,py34,releasenotes
minversion = 1.6
skipsdist = True
@ -83,11 +83,6 @@ commands = {posargs}
[testenv:cover]
commands = /bin/bash run_tests.sh -N --no-pep8 --coverage {posargs}
[testenv:py27dj17]
basepython = python2.7
commands = pip install django>=1.7,<1.8
/bin/bash run_tests.sh -N --no-pep8 {posargs}
# Django-1.8 is LTS
[testenv:py27dj18]
basepython = python2.7