devicehub-django/device/forms.py

18 lines
337 B
Python
Raw Normal View History

2024-07-05 13:32:07 +00:00
from django import forms
2024-07-19 15:40:01 +00:00
from snapshot.models import Annotation
2024-07-05 13:32:07 +00:00
2024-07-19 15:40:01 +00:00
class DeviceForm2(forms.ModelForm):
class Meta:
model = Annotation
fields = ['key', 'value']
class DeviceForm(forms.Form):
name = forms.CharField()
value = forms.CharField()
DeviceFormSet = forms.formset_factory(form=DeviceForm, extra=1)