Skip to content

Commit 7dbcb26

Browse files
author
Rayan
committed
Removed deprecated Django 1.4 syntax
1 parent 6055599 commit 7dbcb26

8 files changed

Lines changed: 18 additions & 18 deletions

File tree

codespeed/templates/codespeed/changes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% block navigation %}
55
{{ block.super }}
66
{% endblock %}
7-
{% block nav-changes %}class="current"><a href="{% url changes %}">Changes</a>{% endblock %}
7+
{% block nav-changes %}class="current"><a href="{% url "changes" %}">Changes</a>{% endblock %}
88

99
{% block body %}
1010
<div id="sidebar">
@@ -66,7 +66,7 @@
6666
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tablesorter.min.js"></script>
6767
<script type="text/javascript" src="{{ STATIC_URL }}js/changes.js"></script>
6868
<script type="text/javascript">
69-
var TIMELINE_URL = "{% url timeline %}";
69+
var TIMELINE_URL = "{% url "timeline" %}";
7070

7171
$(function() {
7272
Changes.config({

codespeed/templates/codespeed/comparison.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% block navigation %}
1010
{{ block.super }}
1111
{% endblock %}
12-
{% block nav-comparison %}class="current"><a href="{% url comparison %}">Comparison</a>{% endblock %}
12+
{% block nav-comparison %}class="current"><a href="{% url "comparison" %}">Comparison</a>{% endblock %}
1313

1414
{% block body %}
1515
<div id="sidebar">

codespeed/templates/codespeed/timeline.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{% block navigation %}
99
{{ block.super }}
1010
{% endblock %}
11-
{% block nav-timeline %}class="current"><a href="{% url timeline %}">Timeline</a>{% endblock %}
11+
{% block nav-timeline %}class="current"><a href="{% url "timeline" %}">Timeline</a>{% endblock %}
1212

1313
{% block body %}
1414
<div id="sidebar">
@@ -102,7 +102,7 @@
102102
<script type="text/javascript" src="{{ STATIC_URL }}js/jqplot/jqplot.canvasTextRenderer.min.js"></script>
103103
<script type="text/javascript" src="{{ STATIC_URL }}js/jqplot/jqplot.canvasAxisLabelRenderer.min.js"></script>
104104
<script type="text/javascript">
105-
var CHANGES_URL = "{% url changes %}";
105+
var CHANGES_URL = "{% url "changes" %}";
106106
</script>
107107
<script type="text/javascript" src="{{ STATIC_URL }}js/timeline.js"></script>
108108
<script type="text/javascript">

codespeed/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
from django.conf.urls.defaults import *
33
from django.core.urlresolvers import reverse
4-
from django.views.generic.simple import direct_to_template
4+
from django.views.generic import TemplateView
55
from tastypie.api import Api
66

77
from codespeed.feeds import LatestEntries
@@ -25,8 +25,8 @@
2525
rest_api.register(ResultBundleResource())
2626

2727
urlpatterns = patterns('',
28-
(r'^$', direct_to_template, {'template': 'home.html'}),
29-
(r'^about/$', direct_to_template, {'template': 'about.html'}),
28+
(r'^$', TemplateView.as_view(template_name='home.html')),
29+
(r'^about/$', TemplateView.as_view(template_name='about.html')),
3030
# RSS for reports
3131
(r'^feeds/(?P<url>.*)/$', LatestEntries()),
3232
)

sample_project/templates/base.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ <h2>{% block page_title %}SPEED CENTER{% endblock page_title %}</h2>
3131
<div id="nav">
3232
{% block navigation %}
3333
<ul class="inline">
34-
<li {% block nav-changes %}><a href=" {% url changes %}">Changes</a>{% endblock %}</li>
35-
<li {% block nav-timeline %}><a href=" {% url timeline %}">Timeline</a>{% endblock %}</li>
36-
<li {% block nav-comparison %}><a href=" {% url comparison %}">Comparison</a>{% endblock %}</li>
34+
<li {% block nav-changes %}><a href=" {% url "changes" %}">Changes</a>{% endblock %}</li>
35+
<li {% block nav-timeline %}><a href=" {% url "timeline" %}">Timeline</a>{% endblock %}</li>
36+
<li {% block nav-comparison %}><a href=" {% url "comparison" %}">Comparison</a>{% endblock %}</li>
3737
</ul>
3838
{% endblock %}
3939
</div>

sample_project/templates/home.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55

66
{% block body %}
77
<div id="presentation" class="clearfix">
8-
<a href="{% url changes %}">
8+
<a href="{% url "changes" %}">
99
<div id="changes" class="menubox">
1010
<h2>Changes</h2>
1111
<p>Track performance changes in the latest revisions</p>
1212
</div>
1313
</a>
14-
<a href="{% url timeline %}">
14+
<a href="{% url "timeline" %}">
1515
<div id="timeline" class="menubox">
1616
<h2>Timeline</h2>
1717
<p>Analyze performance over time</p>
1818
</div>
1919
</a>
20-
<a href="{% url comparison %}">
20+
<a href="{% url "comparison" %}">
2121
<div id="comparison" class="menubox">
2222
<h2>Comparison</h2>
2323
<p>Compare different executables and revisions</p>
@@ -53,7 +53,7 @@ <h2>Comparison</h2>
5353

5454
$(function() {
5555
$("#reports").html(getLoadText("Loading...", 0, true))
56-
.load("{% url reports %}", function(responseText) { updateTable(); });
56+
.load("{% url "reports" %}", function(responseText) { updateTable(); });
5757
});
5858
</script>
5959
{% endblock %}

sample_project/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from django.conf import settings
66
from django.conf.urls.defaults import patterns, include, handler404, handler500
7-
from django.views.generic.simple import redirect_to
7+
from django.views.generic import RedirectView
88
from django.core.urlresolvers import reverse
99
from django.contrib import admin
1010

@@ -16,7 +16,7 @@
1616

1717
urlpatterns += patterns(
1818
'',
19-
#('^$', redirect_to, {'url': '/speed/'}),
19+
#('^$', RedirectView.as_view(url='/speed/')),
2020
)
2121

2222
urlpatterns += patterns(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
version='0.9.1',
88
url='https://github.com/tobami/codespeed',
99
license='GNU Lesser General Public License version 2.1',
10-
install_requires=['django==1.4', 'isodate', 'south<=2.0', 'django-tastypie'],
10+
install_requires=['django==1.5.1', 'isodate', 'south<=2.0', 'django-tastypie'],
1111
packages=find_packages(exclude=['ez_setup', 'sample_project']),
1212
description='A web application to monitor and analyze the performance of your code',
1313
include_package_data=True,

0 commit comments

Comments
 (0)