diff options
author | Dan McGee <dan@archlinux.org> | 2011-05-12 10:33:46 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-05-12 10:33:46 -0500 |
commit | 2261cf40bc5e4a43cc8c1618eb54267da8805f89 (patch) | |
tree | e1b80cc28241b4a28a122d48c2a78a027a3b9cd6 | |
parent | 2470c543d60c96343a5b0fefe04464b5b445b859 (diff) |
Put most recent ISOs first in lists
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | releng/views.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/releng/views.py b/releng/views.py index a810bbbc..3180a9ed 100644 --- a/releng/views.py +++ b/releng/views.py @@ -14,7 +14,8 @@ def standard_field(model, empty_label=None, help_text=None, required=True): help_text=help_text, required=required) class TestForm(forms.ModelForm): - iso = forms.ModelChoiceField(queryset=Iso.objects.filter(active=True)) + iso = forms.ModelChoiceField(queryset=Iso.objects.filter( + active=True).order_by('-id')) architecture = standard_field(Architecture) iso_type = standard_field(IsoType) boot_type = standard_field(BootType) @@ -121,7 +122,7 @@ def test_results_for(request, option, value): raise Http404 option_model = getattr(Test, option).field.rel.to real_value = get_object_or_404(option_model, pk=value) - test_list = real_value.test_set.order_by("iso__name", "pk") + test_list = real_value.test_set.order_by('-iso__name', '-pk') context = { 'option': option, 'value': real_value, |