aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-12-02 15:58:31 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-12-09 18:58:26 +0000
commit2d37a1731a2b681bc976f3f391d65abb7745b6f9 (patch)
tree01b94fe536185accbba8df641aa7b839c8dfc498
parent5839e5b0af45d4c9e05145b16c4ed5817e152606 (diff)
downloadbitbake-2d37a1731a2b681bc976f3f391d65abb7745b6f9.tar.gz
toaster: update to Django 1.5
In order to remain up to date with the relevant technologies, Toaster is updated with this patch to Django 1.5. This also makes headways to allow usage of emerging Django-related technologies. Changes include the startup script Django version check, usage of TemplateView instead of deprecated simple function to do redirects, and update to the new form of the _url_ template tag. Support for Django 1.4.5 is now deprecated. [YOCTO #5558] Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
-rwxr-xr-xbin/toaster4
-rw-r--r--lib/toaster/bldviewer/templates/base.html4
-rw-r--r--lib/toaster/bldviewer/templates/basebuildpage.html8
-rw-r--r--lib/toaster/bldviewer/templates/bpackage.html4
-rw-r--r--lib/toaster/bldviewer/templates/build.html4
-rw-r--r--lib/toaster/bldviewer/templates/layer.html2
-rw-r--r--lib/toaster/bldviewer/templates/package.html2
-rw-r--r--lib/toaster/bldviewer/templates/task.html2
-rw-r--r--lib/toaster/bldviewer/urls.py4
-rw-r--r--lib/toaster/toastermain/urls.py4
10 files changed, 19 insertions, 19 deletions
diff --git a/bin/toaster b/bin/toaster
index d4715fa67..7e51014b7 100755
--- a/bin/toaster
+++ b/bin/toaster
@@ -87,8 +87,8 @@ BBBASEDIR=`dirname ${BASH_SOURCE}`/..
# Verify prerequisites
-if ! echo "import django; print (1,4,5) == django.VERSION[0:3]" | python 2>/dev/null | grep True >/dev/null; then
- echo -e "This program needs Django 1.4.5. Please install with\n\nsudo pip install django==1.4.5"
+if ! echo "import django; print (1,5) == django.VERSION[0:2]" | python 2>/dev/null | grep True >/dev/null; then
+ echo -e "This program needs Django 1.5. Please install with\n\nsudo pip install django==1.5"
return 2
fi
diff --git a/lib/toaster/bldviewer/templates/base.html b/lib/toaster/bldviewer/templates/base.html
index 101880d3e..d58cbeaed 100644
--- a/lib/toaster/bldviewer/templates/base.html
+++ b/lib/toaster/bldviewer/templates/base.html
@@ -14,8 +14,8 @@
<div style="width:100%; height: 100%; position:absolute">
<div style="width: 100%; height: 3em" class="nav">
<ul class="nav nav-tabs">
- <li><a href="{% url all-builds %}">All Builds</a></li>
- <li><a href="{% url all-layers %}">All Layers</a></li>
+ <li><a href="{% url "all-builds" %}">All Builds</a></li>
+ <li><a href="{% url "all-layers" %}">All Layers</a></li>
</ul>
</div>
diff --git a/lib/toaster/bldviewer/templates/basebuildpage.html b/lib/toaster/bldviewer/templates/basebuildpage.html
index 873f271ba..d590f28bc 100644
--- a/lib/toaster/bldviewer/templates/basebuildpage.html
+++ b/lib/toaster/bldviewer/templates/basebuildpage.html
@@ -3,14 +3,14 @@
{% block pagename %}
<ul class="nav nav-tabs" style="display: inline-block">
<li><a>Build {{build.target_set.all|join:"&nbsp;"}} at {{build.started_on}} : </a></li>
- <li><a href="{% url task build.id %}"> Tasks </a></li>
- <li><a href="{% url bpackage build.id %}"> Build Packages </a></li>
+ <li><a href="{% url "task" build.id %}"> Tasks </a></li>
+ <li><a href="{% url "bpackage" build.id %}"> Build Packages </a></li>
{% for t in build.target_set.all %}
{% if t.is_image %}
- <li><a href="{% url tpackage build.id t.pk %}"> Packages for {{t.target}} </a> </li>
+ <li><a href="{% url "tpackage" build.id t.pk %}"> Packages for {{t.target}} </a> </li>
{% endif %}
{% endfor %}
- <li><a href="{% url configuration build.id %}"> Configuration </a> </li>
+ <li><a href="{% url "configuration" build.id %}"> Configuration </a> </li>
</ul>
<h1>Toaster - Build {% block pagetitle %} {% endblock %}</h1>
{% endblock %}
diff --git a/lib/toaster/bldviewer/templates/bpackage.html b/lib/toaster/bldviewer/templates/bpackage.html
index ca092ca6a..07d079298 100644
--- a/lib/toaster/bldviewer/templates/bpackage.html
+++ b/lib/toaster/bldviewer/templates/bpackage.html
@@ -21,9 +21,9 @@
{% for package in packages %}
<tr class="data">
- <td><a name="#{{package.name}}" href="{% url bfile build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td>
+ <td><a name="#{{package.name}}" href="{% url "bfile" build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td>
<td>{{package.version}}-{{package.revision}}</td>
- <td>{%if package.recipe%}<a href="{% url "layer_versions_recipes" package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td>
+ <td><a href="{% url "layer_versions_recipes" package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a></td>
<td>{{package.summary}}</td>
<td>{{package.section}}</td>
diff --git a/lib/toaster/bldviewer/templates/build.html b/lib/toaster/bldviewer/templates/build.html
index 5f623504d..5653cca35 100644
--- a/lib/toaster/bldviewer/templates/build.html
+++ b/lib/toaster/bldviewer/templates/build.html
@@ -23,10 +23,10 @@
</tr>
{% for build in builds %}
<tr class="data">
- <td><a href="{% url configuration build.id %}">{{build.get_outcome_display}}</a></td>
+ <td><a href="{% url "configuration" build.id %}">{{build.get_outcome_display}}</a></td>
<td>{{build.started_on}}</td>
<td>{{build.completed_on}}</td>
- <td>{% for t in build.target_set.all %}{%if t.is_image %}<a href="{% url tpackage build.id t.id %}">{% endif %}{{t.target}}{% if t.is_image %}</a>{% endif %}<br/>{% endfor %}</td>
+ <td>{% for t in build.target_set.all %}{%if t.is_image %}<a href="{% url "tpackage" build.id t.id %}">{% endif %}{{t.target}}{% if t.is_image %}</a>{% endif %}<br/>{% endfor %}</td>
<td>{{build.machine}}</td>
<td>{% time_difference build.started_on build.completed_on %}</td>
<td>{{build.errors_no}}:{% if build.errors_no %}{% for error in logs %}{% if error.build == build %}{% if error.level == 2 %}<p>{{error.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td>
diff --git a/lib/toaster/bldviewer/templates/layer.html b/lib/toaster/bldviewer/templates/layer.html
index fa4fd9bde..c5034dea8 100644
--- a/lib/toaster/bldviewer/templates/layer.html
+++ b/lib/toaster/bldviewer/templates/layer.html
@@ -23,7 +23,7 @@
<td><table>
{% for lv in layer.versions %}
<tr><td>
- <a href="{% url layer_versions_recipes lv.id %}">({{lv.priority}}){{lv.branch}}:{{lv.commit}} ({{lv.count}} recipes)</a>
+ <a href="{% url "layer_versions_recipes" lv.id %}">({{lv.priority}}){{lv.branch}}:{{lv.commit}} ({{lv.count}} recipes)</a>
</td></tr>
{% endfor %}
</table></td>
diff --git a/lib/toaster/bldviewer/templates/package.html b/lib/toaster/bldviewer/templates/package.html
index b1246e788..fda9dab0f 100644
--- a/lib/toaster/bldviewer/templates/package.html
+++ b/lib/toaster/bldviewer/templates/package.html
@@ -20,7 +20,7 @@
<td>{{package.version}}</td>
<td>{{package.size}}</td>
<td>{%if package.recipe %}<a name="{{package.recipe.name}}.{{package.package_name}}">
- <a href="{% url layer_versions_recipes package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td>
+ <a href="{% url "layer_versions_recipes" package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td>
<td>
<div style="height: 4em; overflow:auto">
{% for d in package.package_dependencies_source.all %}
diff --git a/lib/toaster/bldviewer/templates/task.html b/lib/toaster/bldviewer/templates/task.html
index e7253698c..5d9887e84 100644
--- a/lib/toaster/bldviewer/templates/task.html
+++ b/lib/toaster/bldviewer/templates/task.html
@@ -28,7 +28,7 @@
<tr class="data">
<td>{{task.order}}</td>
<td><a name="{{task.recipe.name}}.{{task.task_name}}">
- <a href="{% url layer_versions_recipes task.recipe.layer_version_id %}#{{task.recipe.name}}">{{task.recipe.name}}</a>.{{task.task_name}}</a></td>
+ <a href="{% url "layer_versions_recipes" task.recipe.layer_version_id %}#{{task.recipe.name}}">{{task.recipe.name}}</a>.{{task.task_name}}</a></td>
<td>{{task.recipe.version}}</td>
{% if task.task_executed %}
diff --git a/lib/toaster/bldviewer/urls.py b/lib/toaster/bldviewer/urls.py
index becc67920..b84c95f08 100644
--- a/lib/toaster/bldviewer/urls.py
+++ b/lib/toaster/bldviewer/urls.py
@@ -17,7 +17,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.conf.urls import patterns, include, url
-from django.views.generic.simple import redirect_to
+from django.views.generic import RedirectView
urlpatterns = patterns('bldviewer.views',
url(r'^builds/$', 'build', name='all-builds'),
@@ -28,5 +28,5 @@ urlpatterns = patterns('bldviewer.views',
url(r'^build/(?P<build_id>\d+)/configuration/$', 'configuration', name='configuration'),
url(r'^layers/$', 'layer', name='all-layers'),
url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'),
- url(r'^$', redirect_to, {'url': 'builds/'}),
+ url(r'^$', RedirectView.as_view( url= 'builds/')),
)
diff --git a/lib/toaster/toastermain/urls.py b/lib/toaster/toastermain/urls.py
index d0606bce9..a696a0b21 100644
--- a/lib/toaster/toastermain/urls.py
+++ b/lib/toaster/toastermain/urls.py
@@ -17,7 +17,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.conf.urls import patterns, include, url
-from django.views.generic.simple import redirect_to
+from django.views.generic import RedirectView
from django.views.decorators.cache import never_cache
@@ -29,7 +29,7 @@ urlpatterns = patterns('',
url(r'^simple/', include('bldviewer.urls')),
url(r'^api/1.0/', include('bldviewer.api')),
url(r'^gui/', include('toastergui.urls')),
- url(r'^$', never_cache(redirect_to), {'url': '/simple/'}),
+ url(r'^$', never_cache(RedirectView.as_view(url='/simple/'))),
# Examples:
# url(r'^toaster/', include('toaster.foo.urls')),