Skip to content

Commit ada5521

Browse files
committed
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
1 parent 2ad2219 commit ada5521

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/idtracker/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class IDSearch(forms.Form):
1212
search_rfcnumber = forms.CharField(widget=forms.TextInput(attrs={'size': 5, 'maxlength': 60}))
1313
def __init__(self, *args, **kwargs):
1414
super(IDSearch, self).__init__(*args, **kwargs)
15-
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')]
15+
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')]
1616

1717
class EmailFeedback(forms.Form):
1818
category = forms.CharField(widget=forms.HiddenInput())

ietf/idtracker/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def choices():
4040
choices = staticmethod(choices)
4141
class Meta:
4242
db_table = 'ref_doc_states_new'
43+
ordering = ['document_state_id']
4344
class Admin:
4445
pass
4546

@@ -62,6 +63,7 @@ def __str__(self):
6263
return self.sub_state
6364
class Meta:
6465
db_table = 'sub_state'
66+
ordering = ['sub_state_id']
6567
class Admin:
6668
pass
6769

0 commit comments

Comments
 (0)