2016-07-19 00:30:52 +00:00
|
|
|
from .models import Port, Switch, Room
|
2016-07-06 19:50:15 +00:00
|
|
|
from django.forms import ModelForm, Form
|
|
|
|
|
|
|
|
class PortForm(ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = Port
|
|
|
|
fields = '__all__'
|
|
|
|
|
|
|
|
class EditPortForm(ModelForm):
|
|
|
|
class Meta(PortForm.Meta):
|
|
|
|
fields = ['room', 'machine_interface', 'related', 'details']
|
2016-07-06 21:29:31 +00:00
|
|
|
|
|
|
|
class AddPortForm(ModelForm):
|
|
|
|
class Meta(PortForm.Meta):
|
|
|
|
fields = ['port', 'room', 'machine_interface', 'related', 'details']
|
|
|
|
|
|
|
|
class SwitchForm(ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = Switch
|
|
|
|
fields = '__all__'
|
|
|
|
|
|
|
|
class EditSwitchForm(ModelForm):
|
|
|
|
class Meta(SwitchForm.Meta):
|
|
|
|
fields = ['building', 'number', 'details']
|
|
|
|
|
2016-07-19 00:30:52 +00:00
|
|
|
class EditRoomForm(ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = Room
|
|
|
|
fields = '__all__'
|