8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-26 22:52: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 a0f59cc4a0
commit 91650942b1

View file

@ -10,6 +10,10 @@ class EditPortForm(ModelForm):
class Meta(PortForm.Meta): class Meta(PortForm.Meta):
fields = ['room', 'machine_interface', 'related', 'details'] 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 AddPortForm(ModelForm):
class Meta(PortForm.Meta): class Meta(PortForm.Meta):
fields = ['port', 'room', 'machine_interface', 'related', 'details'] fields = ['port', 'room', 'machine_interface', 'related', 'details']