mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-27 09:23:47 +00:00
25 lines
652 B
Python
25 lines
652 B
Python
from .models import Port, Switch
|
|
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']
|
|
|
|
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']
|
|
|