From 871cf5ad2d8a97c2c9f9f20e237999acbf5e5f2a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 17 Aug 2011 20:53:57 -0500 Subject: Use verbose name for releng options display So we see something like 'Hardware Type' instead of 'Hardware_Type'. Signed-off-by: Dan McGee --- releng/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'releng') diff --git a/releng/views.py b/releng/views.py index 7f895a45..2b3d0936 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 -- cgit v1.2.3-54-g00ecf