From ada5521a9f817ebdf4868c60a29f4a98e81717c6 Mon Sep 17 00:00:00 2001 From: Bill Fenner Date: Wed, 13 Jun 2007 17:23:38 +0000 Subject: [PATCH] Sort states and substates by their ID in the model. Use the right number of hyphens to separate the current ADs from old ADs in the I-D Search form. - Legacy-Id: 374 --- ietf/idtracker/forms.py | 2 +- ietf/idtracker/models.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ietf/idtracker/forms.py b/ietf/idtracker/forms.py index 779caa6c0..911a5f67e 100644 --- a/ietf/idtracker/forms.py +++ b/ietf/idtracker/forms.py @@ -12,7 +12,7 @@ class IDSearch(forms.Form): search_rfcnumber = forms.CharField(widget=forms.TextInput(attrs={'size': 5, 'maxlength': 60})) def __init__(self, *args, **kwargs): super(IDSearch, self).__init__(*args, **kwargs) - self.fields['search_job_owner'].choices = [('', '--All/Any')] + [(ad.id, "%s, %s" % (ad.last_name, ad.first_name)) for ad in IESGLogin.objects.filter(user_level=1).order_by('last_name')] + [('-99', '----------')] + [(ad.id, "%s, %s" % (ad.last_name, ad.first_name)) for ad in IESGLogin.objects.filter(user_level=2).order_by('last_name')] + self.fields['search_job_owner'].choices = [('', '--All/Any')] + [(ad.id, "%s, %s" % (ad.last_name, ad.first_name)) for ad in IESGLogin.objects.filter(user_level=1).order_by('last_name')] + [('-99', '------------------')] + [(ad.id, "%s, %s" % (ad.last_name, ad.first_name)) for ad in IESGLogin.objects.filter(user_level=2).order_by('last_name')] class EmailFeedback(forms.Form): category = forms.CharField(widget=forms.HiddenInput()) diff --git a/ietf/idtracker/models.py b/ietf/idtracker/models.py index adc09869d..040c278d3 100644 --- a/ietf/idtracker/models.py +++ b/ietf/idtracker/models.py @@ -40,6 +40,7 @@ class IDState(models.Model): choices = staticmethod(choices) class Meta: db_table = 'ref_doc_states_new' + ordering = ['document_state_id'] class Admin: pass @@ -62,6 +63,7 @@ class IDSubState(models.Model): return self.sub_state class Meta: db_table = 'sub_state' + ordering = ['sub_state_id'] class Admin: pass