8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-27 07:02:26 +00:00

Class les ports dans l'ordre

This commit is contained in:
Gabriel Detraz 2016-11-24 03:11:04 +01:00 committed by Simon Brélivet
parent ff18296ccb
commit e4b02bfaa5

View file

@ -10,6 +10,10 @@ class EditPortForm(ModelForm):
class Meta(PortForm.Meta):
fields = ['room', 'machine_interface', 'related', 'details']
def __init__(self, *args, **kwargs):
super(EditPortForm, self).__init__(*args, **kwargs)
self.fields['related'].queryset = Port.objects.all().order_by('switch', 'port')
class AddPortForm(ModelForm):
class Meta(PortForm.Meta):
fields = ['port', 'room', 'machine_interface', 'related', 'details']