summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-18 03:53:57 +0200
committerDan McGee <dan@archlinux.org>2011-08-18 03:54:01 +0200
commit871cf5ad2d8a97c2c9f9f20e237999acbf5e5f2a (patch)
tree20dff624cf69f267afc047812855878a5c69d970
parente5d09fb7e9003b7f96685af9c0a722b45746448e (diff)
downloadarchweb-871cf5ad2d8a97c2c9f9f20e237999acbf5e5f2a.tar.gz
archweb-871cf5ad2d8a97c2c9f9f20e237999acbf5e5f2a.tar.xz
Use verbose name for releng options display
So we see something like 'Hardware Type' instead of 'Hardware_Type'. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--releng/views.py5
-rw-r--r--templates/releng/result_list.html2
2 files changed, 4 insertions, 3 deletions
diff --git a/releng/views.py b/releng/views.py
index 7f895a4..2b3d093 100644
--- a/releng/views.py
+++ b/releng/views.py
@@ -81,7 +81,7 @@ def calculate_option_overview(field_name):
is_rollback = field_name.startswith('rollback_')
option = {
'option': model,
- 'name': field_name,
+ 'name': model._meta.verbose_name,
'is_rollback': is_rollback,
'values': []
}
@@ -159,11 +159,12 @@ def test_results_for(request, option, value):
if option not in Test._meta.get_all_field_names():
raise Http404
option_model = getattr(Test, option).field.rel.to
+ option_model.verbose_name = option_model._meta.verbose_name
real_value = get_object_or_404(option_model, pk=value)
test_list = real_value.test_set.select_related().order_by(
'-iso__name', '-pk')
context = {
- 'option': option,
+ 'option': option_model,
'value': real_value,
'value_id': value,
'test_list': test_list
diff --git a/templates/releng/result_list.html b/templates/releng/result_list.html
index 7f9ed45..0233bf8 100644
--- a/templates/releng/result_list.html
+++ b/templates/releng/result_list.html
@@ -3,7 +3,7 @@
{% block content %}
<div class="box">
<h2>Results for:
- {% if option %}{{ option|title }}: {{ value }}{% endif %}
+ {% if option %}{{ option.verbose_name|title }}: {{ value }}{% endif %}
{{ iso_name|default:"" }}
</h2>